I keep on getting:
Undefined method `model_name` for #<DonationForm:0x007ff62ca75470>
I'm pretty sure I'm missing something. I've followed the installation instruction and everything. What could be the reason?
Model:
class Donation < ApplicationRecord
belongs_to :campaign
has_many :anotherthings
end
Controller:
def new
@campaign = Campaign.new
@donation = DonationForm.new(Donation.new)
end
View:
<%= simple_form_for [@campaign, @donation] do |f| %>
<% end %>
Form object:
# app/forms/donation_form.rb
class DonationForm < Reform::Form
property :donation_amount
end
You contract needs to know which model it's connected to.
So what you are are missing is just one line
P.S.:
This could be something unrelated - since you use Rails 5.1 . I haven't tried upgrading yet from 4.2.8
Also - our Gitter channel for Trailblazer project (including reform) is the best place to get help: https://gitter.im/trailblazer/chat