instance method
route
Ruby on Rails 3.1.12
Since v3.0.20Signature
route(routing_code)
Make an entry in Rails routing file config/routes.rb
Example
route "root :to => 'welcome'"
Parameters
-
routing_codereq
Source
# File railties/lib/rails/generators/actions.rb, line 251
def route(routing_code)
log :route, routing_code
sentinel = /\.routes\.draw do(?:\s*\|map\|)?\s*$/
in_root do
inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }
end
end
Defined in railties/lib/rails/generators/actions.rb line 251
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions