Rails: How to Create a New Associated Model From a Collection of Templates -



Rails: How to Create a New Associated Model From a Collection of Templates -

i want have series of workout templates user can select when making booking. booking version of workout template can edited without changing original template.

context

i have personal trainer makes bookings clients. the personal trainer has many workouts. each booking has associated workout can edited booking.

question how create new workout each booking and:

associate new workout's id booking keep template workouts in collection displayed @ new booking form

guess current guess on doing have hidden field workout params in form passed bookings_controller, create method @booking.save && @workout.save i'm stuck on details execute.

it hard understand trying looks want use: http://api.rubyonrails.org/classes/activerecord/nestedattributes/classmethods.html

ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -