我的代码产生unexpected kRETURN
错误。我认为这是一个 HAML 问题,但我不知道为什么或如何解决它:
SyntaxError in MeasurementsController#index
D:/myAppName/app/helpers/application_helper.rb:1: syntax error, unexpected kRETURN
应用程序/helpers/application_helper.rb:
module ApplicationHelper
def flash_helper
return if flash.blank?
out = ""
flash.each do |key, msg|
out += "<div class='flash #{key}'>#{msg}</div>"
end
raw out
end
def comment
# do nothing (ruby functions will always take a block)
end
def assets_server
case Rails.env
when /production|_prod|prd/i
"assets"
when /tqa/i
"assets-tqa"
else
"assets-dev"
end
end
end
我安装了这些宝石:
- 哈姆 (3.1.2, 3.0.25)
- haml-rails (0.3.4)
- 导轨(3.2.6、3.2.3、3.1.0、3.0.7、3.0.1)