質問

Here is my nested resource

  resources :hotels do
    resources :roomtype, :reservations
  end

What I would like to do is to list room types on the reservation form and determine the amount of rooms I wish to book. I have tried accept_nested_attributes_for to no avail. I can't seem to succeed to create proper a working fields_for form within the reservation form.

specs: rails 4.1, ruby 2.1

役に立ちましたか?

解決

Rails 4 uses strong params. Update your model_params method of your Controller to accept nested attributes. Here is a good explanation.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top