I have a definition
def create
@person = Person.new(params.require(:firstname, :lastname, :job).permit(loc))
@person.save
redirect_to @person
When I try to save a new person I get the following error:
ArgumentError in PeopleController#create
wrong number of arguments (5 for 1)
Is there an issue with the way I coded it? I also tried separating out each element with a separate ".require".
params.require(:firstname, :lastname, :job).permit(loc)can you post params and what fields you want to save for person?wrong number of arguments (5 for 1)would suggest that you are passing 5 arguments to a method, but you aren't anywhere in the code you posted. So, the bug is probably somewhere else in your code.Personmodelinitializeas well as anybefore_orafter_initialize