On Sat, Feb 2, 2013 at 6:35 AM, Dave Castellano <lists@ruby-forum.com> wrote:
> Using update_scope_path in the view is routing to "users/show" rather
> than users/update_scope, with "update_scope" becoming the user id.
>
> ( The goal is to change session[:question_scope] to "vip" when the user
> clicks the button in the view. I assume I have to go to a controller
> action to do that.)
Yes.
> In routes.rb:
resources :users
The above includes /users/:id, which *matches first* - winning! So
the routing engine won't ever get to your other route.
match '/users/update_scope'
Reverse the order in routes.rb and try it.
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment