FormGenerator can generate a class of form
Add this line to your application's Gemfile:
gem 'form_generator', github: 'rawhide/form_generator'
And then execute:
$ bundle install
When you have FormGenerator installed and generate a form...
rails generate form example
The following files are created.
app/forms/example_form.rb
spec/forms/example_form_spec.rb
class ExampleForm < BaseForm
attribute :name, String
validates :name, presence: true
end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request