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

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -