What does the code
redirect_to @user
when used in a controller method, mean in Rails?
Where exactly does it redirect to? Does it redirect to a Users controller (If so, which method of the controller), or does it not go through the controller and instead go directly to a view?
Basically it looks up a bunch of stuff about how your resource routes work
think of it like this
send("#{@user.class.name.underscore.downcase}_path", @user)this is probably not the exact code but it should help you visualize whats actually going on.
The controller always runs, in this case it would be the show action of your users controller unless you have some funky router options.
rake routesexplains how the routes are laid out in this case show isget /users/:id => users#show :as => "user_path"the substitution from your incoming model works like this
a regex is created from your route
:id being a param
would match to inbound_object to the path function which is @user
:id is replaced with @user.id