Re: [Rails] form.view.erb containing model related and non-model related fields.

2015-06-28 Thread Colin Law
On 28 June 2015 at 07:36, Padmahas Bn wrote: > Hello all, > > I would like to have a form in which some of the fields are linked to model > and some fields are not. When I use form_for tag it binds to a particular > model and I cannot create form fields that aren't correspond to one of the > colum

Re: [Rails] form.view.erb containing model related and non-model related fields.

2015-06-27 Thread Henry Lawson
Hi, Consider binding your form to an ActiveModel not an ActiveRecord class. In your ActiveModel, you can add in the extra fields that you don't want/have in your ActiveRecord class. Using ActiveModel will also let you follow the same idioms in ActiveRecord, such as validation. Thanks, Henry On 2

[Rails] form.view.erb containing model related and non-model related fields.

2015-06-27 Thread Padmahas Bn
Hello all, I would like to have a form in which some of the fields are linked to model and some fields are not. When I use *form_for* tag it binds to a particular model and I cannot create form fields that aren't correspond to one of the column name of the table (Model). Hence what I think is I