Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
ActionController::Resources::Resource.class_eval do def path @path ||= (path_prefix != false ? "#{path_prefix}/#{path_segment}" : '') end end ActionController::Resources.module_eval do def map_default_collection_actions(map, resource) index_action_options = action_options_for("index", resource) index_route_name = "#{resource.name_prefix}#{resource.plural}" if resource.uncountable? index_route_name << "_index" end formatted_index_path = (resource.path_prefix ? "#{resource.path}.:format" : "#{index_route_name}.:format") map.named_route(index_route_name, resource.path, index_action_options) map.named_route("formatted_#{index_route_name}", formatted_index_path, index_action_options) create_action_options = action_options_for("create", resource) map.connect(resource.path, create_action_options) map.connect(formatted_index_path, create_action_options) end end
This paste will be private.
From the Design Piracy series on my blog: