Module: Oasis::RouteSet

Defined in:
lib/oasis/routes.rb

Overview

this gets mixed into the standard ActionController RouteSet Mapper and provides the API to the mapper.

Instance Method Summary collapse

Instance Method Details

#routing_for(name, *args) ⇒ Object

Raises:

  • (ActionController::RoutingError)


20
21
22
23
24
25
26
27
28
29
# File 'lib/oasis/routes.rb', line 20

def routing_for(name,*args)
  raise ActionController::RoutingError, "#{name} routing collection has already been used once." if Oasis::Routes.apps[name] == false
  raise ActionController::RoutingError, "app: #{name} not registered" unless Oasis::Routes.apps[name]
  
  args = args.extract_options!
  args[:name_prefix] ||= "#{name}_"
  
  with_options(args, &Oasis::Routes.apps[name])
  Oasis::Routes.apps[name] = false
end