rails syntax error, unexpected tIVAR, expecting ')' -- moving method from controller to model -



rails syntax error, unexpected tIVAR, expecting ')' -- moving method from controller to model -

i moved method controller model , getting error below.

syntax error, unexpected tivar, expecting ')' @favorite[:phone_number] = reminder[:phone_number] ^

the error began appear 1 time moved controller model. note did alter minor things when moved such giving method parameter. can spot error?

def self.create_favorite1(reminder_id) reminder = reminder.find (reminder_id) if reminder[:favorite] == true @favorite = favorite.create(params.fetch(fav_params) @favorite[:phone_number] = reminder[:phone_number] @favorite[:picture] = reminder[:picture] @favorite[:user_id] = current_user.id @favorite.save end end

well, you're missing right paren @ end of line...

@favorite = favorite.create(params.fetch(fav_params)

ruby-on-rails

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -