I am using ActiveAdmin in my Rail application. My setup is as follows:
App / Model / Transaction_type RB
Class translation type & lt; ActiveRecord :: Base has_many: accepts_nested_attributes_for translation_details: translation_details, allow_destroy: true end
application / models / translation_detail.rb
Class Translation Dictate & lt; ActiveRecord :: Base is_to: translation_type attr_accessor: id ,: language_from ,: language_to ,: end value
app / admin / Anuwad_taipkarbi
<[: id :, language_from :, language_to :, price: _destroy]> ActiveAdmin.register TranslationType permit_params work: translation_type, translation_details_attributes index column action: translation_type column: translation_details column: created_at column: updated_at action over Filters: translation_type filter: form made_at. F | F.inputs "translation details" do f.input: translation_type f.input: created_at f.input: updated_at end f.inputs do f.has_many: translation_details, allow_destroy: true do | Tran_det | Tran_det.input: language_from ,: collection = & gt; ['Gr', 'n', 'fr', 'd'] tran_det.input: language_to ,: archive = & gt; [ 'G', 'N', 'FR', 'D'] tran_det.input: Price finally ends Phle_filtr the f.actions end controller {@page_title =: translation_type} end
< P> I do not need a section for translation_detail
, so I ended up with app / admin / translation_detail.rb
I have> translation_ship in my translate-type
form Using the above code creates a nested form, but the attributes of translation_detail
have not been saved after submitting. Also, when I try to update or delete translation_detail
, then enter
ID = *
for the typing type ID =
How can this be decided?
It looks like this line
attr_accessor: id,: Language_from,: app / model / translation_digitation
was in error, in language_to:
, but I'm not really sure why.
No comments:
Post a Comment