ArgumentError in ActiveAdmin :: Devise :: SessionsController # create

I installed ActiveAdmin and logged in with default admin username and password while there is an error and hope someone can help me. Thank!

Here is the error:

ArgumentError in ActiveAdmin::Devise::SessionsController#create 
wrong number of arguments (2 for 1)
Rails.root: E:/Ruby/challenger2 - Copy

Application Trace | Framework Trace | Full Trace
app/helpers/sessions_helper.rb:2:in `sign_in'

      

Part of the session_helper.rb file:

module SessionsHelper
  def sign_in(user)

    self.current_user = user    
  end

  def current_user=(user)
    @current_user = user
  end

  def current_user
    @current_user ||= user_from_remember_token
  end

  def signed_in?
    !current_user.nil?
  end

end

      

+3


source to share


1 answer


gem devise that the active administrator depends on, perhaps use the "sign_in" function - this name has one of your SessionHelper member functions. this cause is calling the wrong function. one solution is not to use activeadmin as admin))) and another is to rename the "sign_in" function globally to "sign_in_" like



and don't forget to restart the server: it helps from time to time)

+15


source







All Articles