Module: Blog::WheelhouseRouteConstraints
- Included in:
- BlogHandler
- Defined in:
- lib/blog/wheelhouse_route_constraints.rb
Instance Method Summary collapse
-
#define_action(path, action_name, method, options = {}, &block) ⇒ Object
Fixes handler route definitions in Wheelhouse 1.0 (fixed in 1.1) to allow route constraints to be set (e.g. match route segments to a regex).
Instance Method Details
#define_action(path, action_name, method, options = {}, &block) ⇒ Object
Fixes handler route definitions in Wheelhouse 1.0 (fixed in 1.1) to allow route constraints to be set (e.g. match route segments to a regex).
5 6 7 8 |
# File 'lib/blog/wheelhouse_route_constraints.rb', line 5 def define_action(path, action_name, method, ={}, &block) define_method(action_name, &block) _mapper.match(path, { :via => method, :to => action(action_name) }.merge()) end |