Currently, devise has the URLs as /users/sign_in although I’d like to change this to /signin.
In the routes.rb file, I’ve tried this:
devise_for :users do
get "/signin" => "devise/sessions#new"
match '/signin', :to => 'devise/sessions#new'
get "/signout" => "devise/sessions#destroy"
match '/signout', :to => 'devise/sessions#destroy'
end
But nothing has worked. I get an error saying:
app/controllers/posts_controller.rb:19:in `show'
In the show section, I have
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @post }
end
end
What does show in the controller have to do with devise?
Try this one:
Source: https://github.com/plataformatec/devise/wiki/How-To:-Change-the-default-sign_in-and-sign_out-routes