Module: Paloma::ActionControllerExtension::ClassMethods

Defined in:
lib/paloma/action_controller_extension.rb

Instance Method Summary collapse

Instance Method Details

#js(path_or_options, options = {}) ⇒ Object

Controller wide setting for Paloma.



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/paloma/action_controller_extension.rb', line 27

def js path_or_options, options = {}
  options ||= {}

  scope = {}
  scope[:only] = options[:only] if options[:only]
  scope[:except] = options[:except] if options[:except]

  self.before_action(
    Proc.new {
      self.js path_or_options, options[:params]
    },
    scope)
end