鍍金池/ 問答/網(wǎng)絡(luò)安全/ wrong number of arguments (given 1, expe

wrong number of arguments (given 1, expected 0) ruby on rails

當(dāng)我輸入完密碼的時候,按提交屏幕快照 2018-08-21 下午4.53.10
clipboard.png
他報給我這個錯誤
屏幕快照 2018-08-21 下午4.54.06
clipboard.png
這是我覺得出錯的代碼
class AdminController < ApplicationController
def log_in

  @note = session[:note]

end

def log_out

  session[:note]=nil

end

def create_session

  user=User.find_by(email:params[:email],password:encryption(params[:password]))
  if user
  session[:note]=user.name
  end 
  redirect_to action: :log_in

end



def encryption
    return "aaa"+password
    
end 

end

回答
編輯回答
巴扎嘿

改成

def encryption(password)
    return "aaa"+password
    
end
2018年8月19日 13:15