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
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
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
3 matches
Mail list logo