Add this line:
map.sign_in '/sign_in', :controller => 'session', :action => 'new'
To your config/routes.rb
.
Eugenio Depalo
2010-08-16 15:34:12
Add this line:
map.sign_in '/sign_in', :controller => 'session', :action => 'new'
To your config/routes.rb
.
The
match "sign_in" => "sessions#new"
line creates a route called "sign_in" which you can use in place of "new_session". So anywhere you had been linking to things with "new_session_path", replace it with "sign_in_path".
That's good enough. What I was originally hoping to do would be nice, though--to have "new_session_path" link to the same thing as "sign_in_path". To be able to specify a path_name that doesn't include the controller in it. Then I wouldn't need the match
line at all.
match "sign_in" => "sessions#new", :as => :new_session