Closed wuwx closed 8 years ago
i am use rails 4.2.4 my controller code like this
class Sites::ApplicationController < ::ApplicationController before_action :set_site #theme Proc.new { |controller| @site.theme || 'default' } theme Proc.new { |controller| params[:theme].presence || 'professional' } private def set_site @site ||= Site.find(params[:site_id]) end end
but got error:
undefined local variable or method `params' for Sites::ApplicationController:Class
You need to access from controller.
controller
theme Proc.new { |controller| controller.params[:theme].presence || 'professional' }
i am use rails 4.2.4 my controller code like this
but got error:
undefined local variable or method `params' for Sites::ApplicationController:Class