trailblazer / formular

Form builder for Ruby. Fast, Furious, and Framework-Agnostic.
MIT License
81 stars 17 forks source link

[Bug Report] in v0.2.0 when rendering a form NameError is raised #26

Closed michaellennox closed 8 years ago

michaellennox commented 8 years ago

Description

When attempting to render a form using formular v0.2.0 and cells-rails 0.0.6 a NameError: uninitialized constant Formular::Element::Module::Declarative will be raised.

This was fixed in this commit

To Reproduce

2.3.1 :001 > class DemoCell < Cell::ViewModel
2.3.1 :002?>   include Formular::Helper
2.3.1 :003?>
2.3.1 :004 >     def show
2.3.1 :005?>       "#{form(Customer.new, 'http://example.com/confirm')}"
2.3.1 :006?>     end
2.3.1 :007?>   end
 => :show
2.3.1 :008 > DemoCell.().()
NameError: uninitialized constant Formular::Element::Module::Declarative

Intermediary fix

Using master branch of formular solves the issue:

# in Gemfile

gem 'formular', github: 'trailblazer/formular'

Suggested Resolution

Tag the latest commit as release v0.2.1 and push to rubygems to ensure people installing don't get bitten.

fran-worley commented 8 years ago

Whoops! I forgot to bump this yesterday when I found it.

Now done via https://github.com/trailblazer/formular/commit/d58a1a7462edec84e50f0b641091506f0c7160b8 and released to RubyGems.

michaellennox commented 8 years ago

Thanks for all the great work @fran-worley, it's much nicer to have form helpers that 'just work' with cells instead of all the kerfuffle caused by simpleform and formtastic.

fran-worley commented 8 years ago

Thank you for giving it a go. The docs are pretty sparse at the moment so give me a shout if you need anything.