【发布时间】:2016-02-25 16:38:00
【问题描述】:
我正在接受上述错误。我找不到解决方案。请告诉我。
这是我的 feed_view_mobile.erb 代码;
if params[:controller]=='categories'
meta :title => " #{feed_hash[:filter_keyword]+' | ' if feed_hash[:filter_keyword].present?} " + (feed_hash[:seo_title]||feed_hash[:title]) + ( ((' - Page ' + params[:page]) if params[:page].present?) ||''),
:description => " #{feed_hash[:filter_keyword]+' | ' if feed_hash[:filter_keyword].present?} " + (feed_hash[:description] || '') + ( ((' - Page ' + params[:page]) if params[:page].present?) ||''),
:keywords => (feed_hash[:filter_keyword].split.select{ |x| x.length>2}).concat(feed_hash[:keywords] || feed_hash[:title].split.select{ |x| x.length >2 })
#salwar special case for testing.
@secondary_message = "<a class='btn btn-primary btn-attn' href='"+new_user_registration_path.to_s+"'>Signup </a>" + " and get your free personal stylist." if !current_user.present? && params[:term]!="salwars-churidars"
@secondary_message = ""
end
【问题讨论】:
-
当然,你没有发现你的错误,你的视图代码太复杂了。要开始简化它,请创建辅助方法。
标签: ruby-on-rails ruby