ruby on rails - Capture ParentID param in nested resources -


I want to capture the parent ID param (foreign key) before saving a new hair record.

I have two setups as nested resources in the route setup file and the new child controller action link correctly shows the Nested Parent ID.

When I enter data for the child and the "create" record is made, though I can not capture the parent ID.

Edit

I use the nested set model to relate to the table itself so that there is no FK column. Because there is no FK, I have to capture the parent ID before saving the record and the other LTF of other records is updated; RGT fields accordingly

Routes:

  Rails.application.routes.draw do resources: area resources are: end of areas  < / Pre> 

new form

The following links to create a new child area in the area list include:

The Stakeoverflow will not allow me to post the form field, But I think my problem is that it is posting on the field @ field, which is scrambling to the resources before taking the resources. Is.

The Rake Roots displays the following:

  prefix word URI pattern controller # Action area_reference greg /regions/:region_id/regions(.:format) fields # index post / Department / Area: / Areas / Areas / Areas / New (.: Format) Areas # New Edit_Regression_GridgeGET /regions/:region_id/regions/:id/edit(.:format) Areas # Edit Area / Area Get Gions / : Region_id / regions /: id (.format) area # show patch /regions/:region_id/regions/:id(.:format) field Keep #Updates / Areas /: region_id / regions /: id (.format) regions # update DELETE /regions/:region_id/regions/:id(.:format) # regions to delete / get areas (. : Format) fields # index post / department (.format) fields # new_ region received / field / new (.formatting) area # new edit_region / acquisition / area / ed / edit (.formatting) area # field edit / Department / :( (.: Format) fields # Show patch / s Etron / id.: Format) fields # Update Piuti / segment / added. (: Format) Delete fields # update / segment / ed. (: Format) fields # eliminating & lt;% = form_for (@ Ariane) do | F | | & Gt%; ... & lt; Div class = "verb" & gt; & Lt;% = f.submit% & gt; & Lt; / Div & gt; & Lt;% end% & gt;  


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -