Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

POROs and `@#<PORO>' is not allowed as an instance variable name #14

Open
openfirmware opened this issue Apr 11, 2014 · 0 comments
Open

Comments

@openfirmware
Copy link

Not really an issue as I solved it, but something to note for other users of dynamic_form.

I was implementing dynamic_form with a Plain Old Ruby Object that includes ActiveModel::Validations, and was getting the error in the subject line when trying to use <%= f.error_messages %>.

I didn't find any other instances of this issue, but it can be solved by defining to_model in the PORO:

class Download
  include ActiveModel::Validations
  attr_accessor :name
  validates_presence_of :name

  def to_model
    self
  end
end

Thanks for the gem, works great.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant