Module: ParamAccessible::ControllerExt::ClassMethods

Defined in:
lib/param_accessible/controller_ext.rb

Instance Method Summary collapse

Instance Method Details

#param_accessible(*args) ⇒ Object



22
23
24
# File 'lib/param_accessible/controller_ext.rb', line 22

def param_accessible *args
  param_accessible_rules.push *args
end

#param_accessible_rulesObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/param_accessible/controller_ext.rb', line 26

def param_accessible_rules
  return @param_accessible_rules if defined? @param_accessible_rules
  
  # inheritance
  if superclass.respond_to?(:param_accessible_rules)
    @param_accessible_rules = Rules.new superclass.param_accessible_rules
  else
    common_rails_parameters_rule = Rule.new :controller, :action, :id, :format, :authenticity_token, :commit, :utf8
    @param_accessible_rules = Rules.new [common_rails_parameters_rule]
  end
end