Resources, controllers and models mapping

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.

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 A. [email protected]

Hans M. 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-Koser
http://www.marnen.org
[email protected]

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-

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs