I am looking for a little advice on structuring the following.
I would like to display a single page. On which 3 events can be created or updated. Each event has a specific name (Open, Close, Start)
I would like user to be able to create, 1 or all 3 of the events.
Upon returning to the same url I would like the created events to be displayed for the user to Update, and uncreated events to be available for creation.
For example.
User vists events/new
Creates Event – (called Open)
No action for Close and Start.
Upon returning to events/new
Event (Open) value is displayed. To be updated.
Events Close and Start can be created new.
How would you structure this? I toyed with the idea of implementing find_or_create method. Should this be placed in the create action in the controller, to replace the .create(params[:e.g])?
Many thanks
Ross
In your controller – EventsController:
In your view – events/new.html.haml: