I want to union these lines into one.
devise_for :users do get '/users/sign_out' => 'devise/sessions#destroy' end
devise_for :users, :controllers => { :sessions => 'users'}
I think it should be something like:
devise_for :users do get
'/users/sign_out' => 'devise/sessions#destroy'
:controllers => { :sessions => 'users'}
end
please help
No, the two statements are not the same. Note the second call passes a hash as an argument for
device_forwhile the first call passes a block(get '/users/sign_out' => 'devise/sessions#destroy') this is in no way equivalent to what you propose.If the two statements can be combined into a single one it should be something like:
But this may have a different effect(I am not sure what does
device_fordo) as it changes the order of execution(instead of executing one statement after the other it executes them at the same time.