Rails 3.2 - Nested Resource Passing ID
问题 Okay so my associations are: Outlet -> has_many :monitorings Monitoring -> belongs_to :outlet My Routes: resources :outlets do resources :monitorings end View: <%= link_to new_outlet_monitoring_path(@outlet) %> When I click the link, the logs show that the outlet_id is passed as a parameter to the new page correctly. But when saving the monitoring record, the outlet_id becomes nil. Any help? UPDATE: # views/monitorings/_form.html.erb <%= form_for(@monitoring) do |f| %> <h2>Type of Monitoring<