Reputation: 539
I have this route in my routes.rb
resource: session
It generates the following routes
session_path POST /session(.:format) sessions#create
new_session_path GET /session/new(.:format) sessions#new
edit_session_path GET /session/edit(.:format) sessions#edit
I do not require edit_session_path (at least I don't know yet whether I require it or not) and I have a custom route for signin, so I don't want new_session_path.
Is there a way to tell Rails to not generate these two paths?
Upvotes: 0
Views: 72
Reputation: 12586
Alternatively, if you know which actions you want you can provide it directly via only
, instead of excepting them:
resources :sessions, only: [:create]
Upvotes: 2