sessions_controller.rb
def create
if user = User.authenticate(params[:login], params[:password])
session[:user_id] = user.id
redirect_to posts_path
else
render :action => 'new'
end
end
routes.rb
get "sessions/create"
get "sessions/destroy"
get "sessions/new"
resources :posts
resource :session
resources :users
match '/login', :to => 'sessions#new', :as => 'login'
match '/logout', :to => 'sessions#destroy', :as => 'logout'
Is it possible to keep the /login url after the render :action => "new" ??? thanks.