Ruby on Rails Thursday, July 14, 2016

> This signals to me that your new action does not begin with a / or a
> http(s)://.
>
> This is normal browser behavior.
>
> If you assign a fully-qualified URL or a complete (root-relative) path
> to either an a#href or form#action, the browser will accept that. But if
> your new URL or path is not complete, then the browser will attempt to
> "canonicalize" it by adding the current context to it.
>
> Walter

Hello Walter, it does begin with http://. Another weird thing is if
current URL is localhost..../reports/new, It only discards "/new" part
but keeps "/reports" part. After some time I got to know that "/reports"
is controller and "/new" is action. That's why I want to change
controller dynamically. And as rails converts <% form_tag %> hash to a
valid URL its not converting JS supplied URL.

But I'm OK if I have to use fully qualified URL but need some help with
how I have to tell rails to match that URL to a controller's action.
Finally all I want is to change both controller and action using
JavaScript(which may not possible at all because "controller" hash is of
form_tag helper). Or a workaround equivalent to this.

Thank you.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a7d3cff6183e3b7d3a307d182329bd3d%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment