Module: Adva::Markup::ActionController::InstanceMethods
- Defined in:
- lib/adva/markup/action_controller.rb
Instance Method Summary collapse
Instance Method Details
#render(*args) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/adva/markup/action_controller.rb', line 19 def render(*args) = excluded = [:except].include?(params[:action].to_sym) included = [:only].empty? || [:only].include?(params[:action].to_sym) !excluded && included ? with_filtered_attributes { super } : super end |
#with_filtered_attributes ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/adva/markup/action_controller.rb', line 27 def with_filtered_attributes models = [:models].map(&:constantize) models.each { |model| model.read_filtered_attributes = true } yield.tap do models.each { |model| model.read_filtered_attributes = false } end end |