[Rails] Instantiating a new object with a template, through an association

2012-01-31 Thread Vladiim
class Project ActiveRecord::Base has_one :template end class Template ActiveRecord::Base belongs_to :project, foreign_key: project_id end When you create a new project I'd like you to select the template from a collection of existing templates (created by an admin). The new

[Rails] Booking Engine With Editable Associated Model

2012-01-24 Thread Vladiim
I'm creating a booking engine for personal trainers to make bookings with their clients. Each booking has_one workout template which in turn has_many exercises. When the personal trainer creates the booking I'd like them to be able to edit the associated workout template as a completely fresh

[Rails] Re: Booking Engine With Editable Associated Model

2012-01-24 Thread Vladiim
Excellent advice... I'm a fan of your idea of having nested resources as I had a fear of massive versioning tables with my original approach. I'll give this a G-O. On Jan 25, 1:18 am, Walter Lee Davis wa...@wdstudio.com wrote: On Jan 24, 2012, at 1:31 AM, Vladiim wrote: I'm creating a booking