我无法弄清楚为什么会抛出语法错误:
if feeds.include? 'job'
#when only updating one attribute use this over 'update(params)'
broadcast.update_attribute(:jobs true)
else
#do nothing at the moment
end
错误信息是:
app/models/broadcast_service.rb:17: syntax error, unexpected keyword_true, expecting ')'
app/models/broadcast_service.rb:100: syntax error, unexpected $end, expecting keyword_end
:jobs
是boolean
,我想将其值设置为true
其中line 17 is the above
和line 100 is the very last line of the file
,end keyword
答案 0 :(得分:0)
愚蠢的我错过了参数之间的逗号。
if feeds.include? 'job'
#when only updating one attribute use this over 'update(params)'
broadcast.update_attribute(:jobs, true)
else
#do nothing at the moment
end