instance method
route_resources
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
route_resources(*resources)
No documentation comment.
Parameters
-
resourcesrest
Source
# File railties/lib/rails_generator/commands.rb, line 363
def route_resources(*resources)
resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
sentinel = 'ActionController::Routing::Routes.draw do |map|'
logger.route "map.resources #{resource_list}"
unless options[:pretend]
gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
"#{match}\n map.resources #{resource_list}\n"
end
end
end
Defined in railties/lib/rails_generator/commands.rb line 363
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generator::Commands::Create