Hi all.. I''m new to the list and new to Ruby+Rails, so please be patient with me.. I''ve been using Mojavi 2 for a while now and know the framework well enough to get my app going pretty well, but am really feeling confused w/ Rails and how to get my app up and going in some limited way in Rails. In Mojavi I''ve got the following actions defined : ContactAction ContactUpdateAction DefaultIndexAction LoginAction LogoutAction MainAction OrderAction ReportAction Now, these really define the main top-level actions available -- login, logout, update-contact-info, orders and reports. I''m currently thinking after reviewing tutorials and weblogs, that my Mojavi actions should map (almost 1-1?) to Rails'' controllers. However, before I go down that path, I''d like to double-check my main thinking with the collective rails audience.. Comments? -- Rick
Rodrigo Alvarez Fernández
2005-Sep-18 11:05 UTC
Re: Rails newbie trying out Rails after using Mojavi+PHP
On 9/18/05, Rick Flower <rickf-gqmXzWjnWO954TAoqtyWWQ@public.gmane.org> wrote:> > [...] > logout, update-contact-info, orders and reports. I''m currently thinking > after reviewing tutorials and weblogs, that my Mojavi actions should map > (almost 1-1?) to Rails'' controllers. >Actions should map to methods in controllers, not controllers themselves. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Rick Flower
2005-Sep-18 18:00 UTC
Re: Rails newbie trying out Rails after using Mojavi+PHP
Rodrigo Alvarez Fernández wrote:> On 9/18/05, *Rick Flower* <rickf-gqmXzWjnWO954TAoqtyWWQ@public.gmane.org > <mailto:rickf-gqmXzWjnWO954TAoqtyWWQ@public.gmane.org>> wrote: > > [...] > logout, update-contact-info, orders and reports. I''m currently > thinking > after reviewing tutorials and weblogs, that my Mojavi actions > should map > (almost 1-1?) to Rails'' controllers. > > > Actions should map to methods in controllers, not controllers themselves.Ok.. With that in mind, should the "typical" web-app have a single controller or multiples? Based on your comment, it sounds like a single is more the norm.. -- Rick
Tomas Jogin
2005-Sep-18 18:41 UTC
Re: Rails newbie trying out Rails after using Mojavi+PHP
> > Actions should map to methods in controllers, not controllers themselves. > Ok.. With that in mind, should the "typical" web-app have a single > controller or multiples? Based on your comment, it sounds like a single > is more the norm.. > > -- RickMultiple in all but the simplest cases (like a guestbook). You could say that controllers are logical groupings of actions. So you might have a Contact controller, with for instance a View action and an Update action. You might also have an Authorization controller, with actions like Login and Logout. Furthermore, there might be an Order controller, with actions such as Show, New, Update, Delete. Regards, Tomas Jogin
Rick Flower
2005-Sep-19 06:07 UTC
Re: Rails newbie trying out Rails after using Mojavi+PHP
Tomas Jogin wrote:>>> Actions should map to methods in controllers, not controllers themselves. >>> >> Ok.. With that in mind, should the "typical" web-app have a single >> controller or multiples? Based on your comment, it sounds like a single >> is more the norm.. >> >> -- Rick >> > > Multiple in all but the simplest cases (like a guestbook). You could > say that controllers are logical groupings of actions. So you might > have a Contact controller, with for instance a View action and an > Update action. You might also have an Authorization controller, with > actions like Login and Logout. Furthermore, there might be an Order > controller, with actions such as Show, New, Update, Delete. >Excellent.. I guess I wasn''t too far off the beaten track.. I guess I''ll see about making a login/out controller, one for contacts, orders and reports,etc.. Thanks for the help and info! Unfortunately, I''m sure this wont be the last question I''ve got.. Thanks again! -- Rick