So, I have: Tune.has_many :tags, :through => :taggings Tune.has_many :taggings Tag.has_many :tunes, :through => :taggings Tag.has_many :taggings Tagging.belongs_to :tune Tagging.belongs_to :tag (It''s a bit more polymorphic than that, but...) I have a TagsController which is mostly about accessing tag clouds rather than editing the taggings of a particular tune, and I have a TaggingsController which I would like to wire up using map.resource because, although a tune''s ''taggings'' resource is a collection, the things in the collection won''t/can''t be accessed individually - it makes more sense for the user to manipulate the collection as a whole. However, when I do map.resources :tunes do |tune| tune.resource :taggings end Rails singularizes ''taggings'' and gives me paths like: /tunes/10/tagging/edit I''d really like to be able to force resource to leave ''taggings'' alone when it starts making paths, but :singular doesn''t work for the ''resource'' method. Before I go ahead and write a patch, I just want to get a feel for whether others want this, and if they do, which of tune.resource :taggings, :singular => ''taggings'' or tune.resource :taggings, :singularize_path => false people prefer. I think I lean towards the second option... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
tune.resource :tagging, :as => ''whatever_floats_your_boat'' HTH, Trevor On 3/12/08, Piers Cawley <pdcawley@bofh.org.uk> wrote:> > So, I have: > > Tune.has_many :tags, :through => :taggings > Tune.has_many :taggings > > Tag.has_many :tunes, :through => :taggings > Tag.has_many :taggings > > Tagging.belongs_to :tune > Tagging.belongs_to :tag > > (It''s a bit more polymorphic than that, but...) > > I have a TagsController which is mostly about accessing tag clouds > rather than editing the taggings of a particular tune, and I have a > TaggingsController which I would like to wire up using map.resource > because, although a tune''s ''taggings'' resource is a collection, the > things in the collection won''t/can''t be accessed individually - it > makes more sense for the user to manipulate the collection as a whole. > However, when I do > > map.resources :tunes do |tune| > tune.resource :taggings > end > > Rails singularizes ''taggings'' and gives me paths like: > > /tunes/10/tagging/edit > > I''d really like to be able to force resource to leave ''taggings'' alone > when it starts making paths, but :singular doesn''t work for the > ''resource'' method. > > Before I go ahead and write a patch, I just want to get a feel for > whether others want this, and if they do, which of > > tune.resource :taggings, :singular => ''taggings'' > > or > > tune.resource :taggings, :singularize_path => false > > people prefer. I think I lean towards the second option... > > > >-- -- Trevor Squires http://somethinglearned.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, Mar 12, 2008 at 3:31 PM, Trevor Squires <trevor@protocool.com> wrote:> > tune.resource :tagging, :as => ''whatever_floats_your_boat''D''oh!> HTH,Indeed it does. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---