Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/transit/rails/routing.rb

Instance Method Summary collapse

Instance Method Details

#transit(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/transit/rails/routing.rb', line 4

def transit(*args)
  options = args.extract_options!
  
  Transit::Engine.routes.draw do      
    args.map(&:to_s).map(&:pluralize).each do |mod|
      Transit.add_mapping(mod)
      resources mod do
        resources :contexts
      end
    end
  end      
  mount Transit::Engine => (options[:mount_on] || "/transit")
end