Re: Basic routing question

Hassan Schroeder
2013-02-02T16:14:59Z

On Sat, Feb 2, 2013 at 6:35 AM, Dave Castellano
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
http://about.me/hassanschroeder
twitter: @hassan