lib/transit/rails/routing.rb in transit-0.0.1 vs lib/transit/rails/routing.rb in transit-0.0.2

- old
+ new

@@ -1,13 +1,18 @@ module ActionDispatch::Routing class Mapper - def transit(*models) - options = models.extract_options! - Transit::Engine.routes.draw do - models.map(&:to_s).map(&:pluralize).each do |mod| - resources mod, :controller => "#{mod}" + + 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 + end mount Transit::Engine => (options[:mount_on] || "/transit") end end end \ No newline at end of file