collection-select

Rails has_many :through with collection_select form helper

本小妞迷上赌 提交于 2019-12-02 18:17:09
问题 I'm having issues with creating a form that will save my has_many :through associations. I've successfully saved by posting json, but the forms just won't work for me yet. The request params created by the form submit just won't work out. Any help pointing me to the solution would help me from losing any more time on this. Thanks up front. EDITED -- Added forms_for attempt and the created params json that doesn't work as well at the bottom -- Json post request params that works: { "author": {

Rails has_many :through with collection_select form helper

冷暖自知 提交于 2019-12-02 08:00:34
I'm having issues with creating a form that will save my has_many :through associations. I've successfully saved by posting json, but the forms just won't work for me yet. The request params created by the form submit just won't work out. Any help pointing me to the solution would help me from losing any more time on this. Thanks up front. EDITED -- Added forms_for attempt and the created params json that doesn't work as well at the bottom -- Json post request params that works: { "author": { "name": "Author Name", "post_authors_attributes": [ {"post_id":"1"}, {"post_id":"2"}, {"post_id":"3"}