Class: ActionDispatch::Routing::Mapper

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

Instance Method Summary collapse

Instance Method Details

#imhotep(*resources) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/imhotep/routes.rb', line 4

def imhotep(*resources)
  options = resources.extract_options!
  
  resources.each do |resource|
    options[:except] = [:new, :create]
    options[:path] = "#{options[:path] || resource}(/*path)/:name"
    self.resource resource, options
  end
end