Module: Voltron::Notify::Routes

Defined in:
lib/voltron/notify/action_dispatch/routes.rb

Instance Method Summary collapse

Instance Method Details

#allow_notification_update(options = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/voltron/notify/action_dispatch/routes.rb', line 5

def allow_notification_update(options={})
  path = (options[:path] || '/notification/update').gsub(/(^[\s\/]+)|([\s\/]+$)/, '')
  controller = (options[:controller] || 'voltron/notification')
  action = (options[:action] || 'update')
  post path, to: "#{controller}##{action}", as: :update_voltron_notification
end