averageyeo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-May-29 18:42 UTC
Possible to have a model named ''Application''?
Just wondering if it''s possible to have a model named Application in rails 2.0. It seems to be blowing up when I try, and I''m wondering if there''s a workaround. Thanks! --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-29 19:37 UTC
Re: Possible to have a model named ''Application''?
On May 29, 7:42 pm, "average...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <average...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Just wondering if it''s possible to have a model named Application in > rails 2.0. It seems to be blowing up when I try, and I''m wondering if > there''s a workaround. Thanks!Probably asking for trouble seeing as application_controller lives in application.rb (for (from what I gather) largely historical reasons. Fred --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
A model named Application is going to map, by default, to a controller named application_controller. And that name''s already taken. You can work around it if you really want to, but you''ll find it a lot easier to just name your model something else. MyApplication, InHouseApplication, etc. HTH, Bill --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Can''t he use a named route without any problems? On May 30, 2:04 am, "Bill Walton" <bill.wal...-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> A model named Application is going to map, by default, to a controller named > application_controller. And that name''s already taken. You can work around > it if you really want to, but you''ll find it a lot easier to just name your > model something else. MyApplication, InHouseApplication, etc. > > HTH, > Bill--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
I''d pass on using Application as a model name. I''d become familiar with the conventions of Rails and make sure that I didn''t name any models Application or Layout for starters averageyeo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Just wondering if it''s possible to have a model named Application in > rails 2.0. It seems to be blowing up when I try, and I''m wondering if > there''s a workaround. Thanks! > > > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Might work, but it''s gonna be trouble-prone. Rails is convention-based. The conventions are ''baked-in''. Unscramble an egg ;-) --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---