Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/morphing/rails/routes.rb

Instance Method Summary collapse

Instance Method Details

#morphing_for(options = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/morphing/rails/routes.rb', line 3

def morphing_for(options = {})
  controller_name = options[:controller] || 'morphing/morphing'

  get '/morph/:id'    => "#{controller_name}#morph", as: :morph
  get '/unmorph'      => "#{controller_name}#unmorph", as: :unmorph
end