0
我得到上述錯誤。我找不到解決方案。請告訴我。ActionView :: Template :: Error:未定義的方法`拆分'爲零:NilClass
這是我的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
當然,你沒有發現你的錯誤,你的視圖代碼很複雜。爲了簡單起見,創建輔助方法。 – Meier