문제

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