Trying to upgrade from Ruby 2.0 / Rails 4.0 to Ruby 2.2 / Rails 4.2, I
face a surprising error when logging into my application (based on Rails
Tutorial by M. Hartl):
Instruction: redirect_to root_url
Error message: wrong number of arguments (2 for 1)
Here is the sessions controller:
class SessionsController < ApplicationController
user = User.find_by_login(params[:session][:login])
if user && user.authenticate(params[:session][:password])
flash.now[:error] = 'Invalid login/password combination'
Here is the routes file:
get '/help', to: "static_pages#help"
get '/about', to: "static_pages#about"
get '/contact', to: "static_pages#contact"
root to: "dashboards#home"
resources :sessions, only: [:new, :create, :destroy]
get '/signin', to: 'sessions#new' , via: :get
match '/signout', to: 'sessions#destroy', via: :delete
resources :parameters_lists do
I did not find anything in Rails upgrade guides regarding the
redirect_to function. Your help is welcome! Thanks!