Module: Virtuatable::Helpers::Routes
- Included in:
- Controllers::Base
- Defined in:
- lib/virtuatable/helpers/routes.rb
Instance Method Summary collapse
Instance Method Details
#current_route ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/virtuatable/helpers/routes.rb', line 4 def current_route splitted = request.env['sinatra.route'].split(' ') verb = splitted.first.downcase self.class.api_routes.find do |route| route.verb == verb && route.path == splitted.last end end |