Skip to content
This repository was archived by the owner on May 8, 2022. It is now read-only.
This repository was 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

@openfirmware

Description

@openfirmware

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions