rails setting form_for id attribute causes: Couldn't find Folder with 'id'=add_client -


मेरे पास एक फार्म है जिसके लिए ऐसा लगता है:

  & lt; div class = "modal -body "& gt; & Lt;% = form_for @ फोल्डर, यूआरएल: add_client_folders_path, html: {आईडी: "add_client"} करना | च | & Gt%; & Lt;% = f.fields_for: client_profiles do | client_builder | | & Gt%; & Lt;% = client_builder.select: आईडी, @ clients.collect {| ग्राहक | [क्लाइंट.नाव, क्लाइंट.आईडी]}, {include_blank: true}, {class: "form-control"}% & gt; & Lt;% end% & gt; & Lt;% end% & gt; & Lt; / div & gt; & Lt; div class = "modal-footer" & gt; & Lt;% = submit_tag "क्लाइंट जोड़ें", वर्ग: "बीटीएन बीटीएन-प्राथमिक", फ़ॉर्म: "add_client"% & gt; & Lt; / div & gt; पैरामीटर: {"utf8" => "✓", "प्रामाणिकता_टोकन" => "7qxjMI1H /    

= "" क्लाइंट जोड़ें "," id "=>" + "" ग्राहक "=> {" client_attributes "=> {" 0 "=> {" id "=>" 25 "}}}," कमिट " Add_client "}

यह मुझे नीचे त्रुटि देता है:

  'id' = add_client के साथ फ़ोल्डर नहीं मिल सका  

क्यों क्या रेल यह हैश में HTML आईडी विशेषता को इस त्रुटि के कारण जमा कर रही है?

यहां तक ​​कि जब मैं आईडी निकालता हूं, यह अभी भी मुझे यह त्रुटि दे रहा है मार्ग इस तरह दिखता है:

  संसाधन: फ़ोल्डर्स पोस्ट करते हैं: add_client, पर:: संग्रह समाप्ति  

जब मैं स्पष्ट रूप से पोस्ट विधि घोषित करता हूं, यह ठीक सबमिट करता है:

  विधि:: पोस्ट  

लेकिन मुझे यहां विधि को क्यों निर्दिष्ट करना चाहिए?

भावी पाठकों के लिए, मुझे एक अलग संसाधन मार्ग बनाने से बेहतर विचार है आप अद्यतन सशक्त संसाधन का पुन: उपयोग करना जारी रख सकते हैं क्योंकि जब आप मौजूदा रिकॉर्ड को अपडेट करते हैं तो नया एसोसिएशन स्वतः सहेजा जाएगा:

  & lt;% = form_for @folder do | f | & Gt%; & Lt;% = f.fields_for: client_profiles, f.object.client_profiles.build do | client_builder | & Gt%; & Lt;% = client_builder.select: आईडी, @ clients.collect {| ग्राहक | [Client.full_name, client.id]}, {include_blank: true}, {class: "form-control"}% & gt; & Lt;% = f.submit "क्लाइंट जोड़ें", वर्ग: "बीटीएन बीटीएन-प्राथमिक"%  

>


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -