Hi guys, I''m adding some test coverage to Rails-Core (yay heckle!), and noticed some odd things in the routing code. Using the latest trunk, if I do something like this: map.resource :assertions, :name_prefix => ''badass_'' I get these routes: formatted_badass_assertions badass_assertions formatted_badass_edit_assertions badass_edit_assertions formatted_badass_new_assertions badass_new_assertions Does it seem like the name_prefix should always be coupled with the resource name to anyone else? So formatted_edit_badass_assertions vs formatted_badass_edit_assertions? And that brings up another point actually.. Why when using name_prefix does edit_assertion become edit_assertionS? The tests say that it _should_ be the controller name (plural) instead of the singular name, but this seems wrong. Ideas? Is this a bug? -- Kevin Clark http://glu.ttono.us --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ok, the singular/plural was a bug on my part. At the same time, does anyone feel like the name_prefix and the resource should be together, rather than just prefixing it to the beginning of the route? Yes, I know changing it now would break code. I''m just throwing it out there. Kev On 1/16/07, Kevin Clark <kevin.clark@gmail.com> wrote:> Hi guys, > I''m adding some test coverage to Rails-Core (yay heckle!), and noticed > some odd things in the routing code. > > Using the latest trunk, if I do something like this: > > map.resource :assertions, :name_prefix => ''badass_'' > > I get these routes: > > formatted_badass_assertions > badass_assertions > formatted_badass_edit_assertions > badass_edit_assertions > formatted_badass_new_assertions > badass_new_assertions > > Does it seem like the name_prefix should always be coupled with the > resource name to anyone else? So formatted_edit_badass_assertions vs > formatted_badass_edit_assertions? > > And that brings up another point actually.. Why when using name_prefix > does edit_assertion become edit_assertionS? The tests say that it > _should_ be the controller name (plural) instead of the singular name, > but this seems wrong. > > Ideas? Is this a bug? > > -- > Kevin Clark > http://glu.ttono.us >-- Kevin Clark http://glu.ttono.us --~--~---------~--~----~------------~-------~--~----~ 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 Jan 16, 2007, at 10:06, Kevin Clark wrote:> > Ok, the singular/plural was a bug on my part. At the same time, does > anyone feel like the name_prefix and the resource should be together, > rather than just prefixing it to the beginning of the route?It looks more natural to me. I say: go for it. Manfred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> It looks more natural to me. I say: go for it.Sadly, we''ve missed 1.2 ... (honest, it''s coming real soon now, honest). Plus it''s been documented in a few dead-tree books, and we try not to break them too often. Now accepting patches to make something simpler but still backwards compatible, in trunk. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---