I have a person table and an event table (and many mores, but these two illustrates my problem) A person has many events I have a person resource and an event resource to manage the records in the tables Now I also want to manage person and events together in a more user friendly way. My problem is now how to design the application ? 1. Should I have one person controller and one person resource, one event controller and on event resource and add a set of actions to the person and/or event controller to handle the user friendly management of persons and events ? 2. Should I have specifc controllers and resources representing different representations of persons and events, as the user friendly integrated representation and the table representation, each (if possible) limited to the seven basic actions (index, show, new , edit etc) ? E.g a person controller, an event controller and a person-event controller and corresponding resources! 3. Should I have a specific person-event controller with many specific actions, in addition to the person and event controller, that uses the same person and event resources?
ok you can do it person table function write in event controller you have specify it''s direction controller name and action name For. Ex. I have users and products i want to display product list in users folder then create file pro.html.erb and pro define in users controller it is work perfect. -- Posted via http://www.ruby-forum.com/.
Thanks for the advice However, I think all proposed solutions (1-3) will work, (I use solution 3 for the moment, that also works), but which one is the most RESTful one and which is to prefer from a software design point of view On Aug 17, 11:12 am, Wap Addon <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> ok you can do it person table function write in event controller you > have specify it''s direction controller name and action name > For. Ex. > I have users and products > i want to display product list in users folder then create > file pro.html.erb and pro define in users controller it is work perfect. > -- > Posted viahttp://www.ruby-forum.com/.
Hans Marmolin wrote:> Thanks for the advice > However, I think all proposed solutions (1-3) will work, (I use > solution 3 for the moment, that also works), but which one is the most > RESTful one and which is to prefer from a software design point of > viewIf I understand the original post correctly, the simplest and most easily RESTful solution would be 2. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen, I agree but as I had not found any guides recommending 2, I hesitated to take that approach I am just now implementing it supported by your recommendation Thanks for all help On Aug 18, 5:54 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> HansMarmolin wrote: > > Thanks for the advice > > However, I think all proposed solutions (1-3) will work, (I use > > solution 3 for the moment, that also works), but which one is the most > > RESTful one and which is to prefer from a software design point of > > view > > If I understand the original post correctly, the simplest and most > easily RESTful solution would be 2. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.