Module: Adva::Markup::ActionController::ActMacro

Defined in:
lib/adva/markup/action_controller.rb

Instance Method Summary collapse

Instance Method Details

#filtered_attributes(*models) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/adva/markup/action_controller.rb', line 5

def filtered_attributes(*models)
  options = models.extract_options!
  options[:models] = models.map(&:to_s).map(&:camelize)
  options[:only]   = Array(options[:only]).map(&:to_sym)
  options[:except] = Array(options[:except]).map(&:to_sym)

  class_inheritable_accessor :filtered_attribute_options
  self.filtered_attribute_options = options

  include InstanceMethods
end