Hi all,
Let’s assume I have a calendar show view (calendar controller). On
that view you can view a calendar with all its events. You can also
add, edit and delete events (via the events controller) on that same
view.
Let’s assume the user creates a new event but forgets to fill in some
data and the validation (and insert operation) fails. You want to use
the render :action => ‘calendars/show’ method to show the validation
error on the form in the calendar controller.
The problem I’m facing is that when you render the calendar view you
need other variables (like all the events of the calendar). Of course
you can add @events = Event.find(:all) in the create method of the
events controller but in my opinion this completely ruins the restful
philosophy: your create method isn’t a real create method anymore, it
has also become an index method.
I’m really interested in your opinion and how you design your
controllers to solve this problem.
Many thanks in advance.
Stijn