ruby on rails - Undefined method `to_hash' while saving with reform gem -
ruby on rails - Undefined method `to_hash' while saving with reform gem -
i got problem. i'm using reform gem in rails application complex forms. unfortunately stuck while creating form. that's code:
class order::form < reform::form include coercion include composition include reform::form::activerecord property :subscription, on: :order property :due_date, type: date, on: :order property :start_fee, numericality: true, on: :order collection :products, populate_if_empty: product, on: :order property :type property :budget end property :campaign, on: :order property :customer_id property :customer property :id property :organization_number end end model :order def persist!(params) if validate(params) binding.pry # begin ::activerecord::base.transaction save |data, map| ... end end # rescue exception # false # end end end end
and when i'm trying save recieve error:
nomethoderror - undefined method `to_hash' #<#<class:0x007f984ddef6d8>:0x007f984a65a4>
i wonder if correctly configured composition nested models.
i had same exception, , happened because redefining 1 constant (env
) setting string
. because global constant type hash
, gem using got confused.
try see if somewhere else replacing value of used hash.
ruby-on-rails forms hash gem reform
Comments
Post a Comment