diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-01 04:40:30 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-01 04:40:30 +0000 |
commit | 8ce54793074ebd03bd2bf301c1f9ab7b180f054a (patch) | |
tree | febc16b9957c933204eb1bf36b8f4a09518158de /actionpack/lib/action_controller | |
parent | 507da04a149b44e20c5a0ba72a218fe1762b6baf (diff) | |
download | rails-8ce54793074ebd03bd2bf301c1f9ab7b180f054a.tar.gz rails-8ce54793074ebd03bd2bf301c1f9ab7b180f054a.tar.bz2 rails-8ce54793074ebd03bd2bf301c1f9ab7b180f054a.zip |
Routing: map.resource :logo routes to LogosController so the controller may be reused for multiple nestings or namespaces.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6922 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/resources.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index 45be7b6f11..a7e1a172cc 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -49,8 +49,8 @@ module ActionController attr_reader :options def initialize(entities, options) - @plural = entities - @singular = options[:singular] || plural.to_s.singularize + @plural ||= entities + @singular ||= options[:singular] || plural.to_s.singularize @options = options @@ -122,11 +122,9 @@ module ActionController class SingletonResource < Resource #:nodoc: def initialize(entity, options) - @plural = @singular = entity - @options = options - arrange_actions - add_default_actions - set_prefixes + @singular = @plural = entity + options[:controller] ||= @singular.to_s.pluralize + super end alias_method :member_path, :path |