Eric Gross
2006-Oct-01 19:22 UTC
Does a "User" controller have a naming conflict within ROR?
Hi, I called one of my controllers "User". I then created a modular controller under that called "Profile." I have other modular controllers in my program that works fine, however, in the routing, when I mirror the other routes and do: map.connect ''profile/:action/:id'', :controller=>''user/profile'' it doesnt work. However if I make controller called users, then I can do: map.connect ''profile/:action/:id'', :controller=>''userS/profile'' it does work. Any idea why this is or how to fix it. I would just use "Users" but its inconsistent with my singular controller naming scheme... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Eric Gross
2006-Oct-02 04:04 UTC
Re: Does a "User" controller have a naming conflict within R
anybody? Eric Gross wrote:> Hi, > > I called one of my controllers "User". > I then created a modular controller under that called "Profile." > I have other modular controllers in my program that works fine, however, > in the routing, when I mirror the other routes and do: > > map.connect ''profile/:action/:id'', :controller=>''user/profile'' > > it doesnt work. However if I make controller called users, then I can > do: > > map.connect ''profile/:action/:id'', :controller=>''userS/profile'' > > it does work. Any idea why this is or how to fix it. I would just use > "Users" but its inconsistent with my singular controller naming > scheme...-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I have a controller called user without any problems. What however can be a problem is if you have a model class called User, IIRC rails will get confused (have a modular controller may or may not be a factor, I can''t remember) Fred -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Eric Gross
2006-Oct-02 08:35 UTC
Re: Does a "User" controller have a naming conflict within R
Hmm, thats interesting because I do have a model called User, do you that is it? Is there anyway around this? Fred wrote:> I have a controller called user without any problems. What however can > be a problem is if you have a model class called User, IIRC rails will > get confused (have a modular controller may or may not be a factor, I > can''t remember) > > Fred-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ashley Thomas
2006-Oct-02 14:27 UTC
Re: Does a "User" controller have a naming conflict within R
Eric Gross wrote:> I called one of my controllers "User". > I then created a modular controller under that called "Profile."You can''t have two Modules with the same name. Class is an extension of Module, so the class User conflicts with the module User which contains ProfileController. I had the same problem and solved it the same way you did, by renaming the module Users. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---