我在视图中收到此错误:
SyntaxError in PublicController#fast
C:/Rails/konkurranceportalen/app/controllers/public_controller.rb:11: syntax error, unexpected tASSOC, expecting keyword_end
@titel => 'Heading'
^\
我在控制器中的动作:
def fast
render :template => 'kategoris/show', :layout => 'kategori'
@titel => 'Heading'
@konkurrancers = Konkurrancer.where('type', 'nyhedsbrev')
end
答案 0 :(得分:4)
你只想要@titel = 'Heading'
。 =>
用于构建Hash
es,如`foo = {:a => 1,:b => “棒”}