This project is archived and is in readonly mode.

#6082 ✓invalid
Jack Kinsella

Generator allowing for a custom form framework (E.g. Formtastic)

Reported by Jack Kinsella | November 29th, 2010 @ 10:56 AM

Hi,

In the spirit of making Rails more modular I am considering creating a patch enabling developers to invoke a custom form generator during scaffold generation, such as choosing Formtastic or Simple Form instead of the Rails default. The API would be something like this:

config.generators do |g|

g.form_framework :formtastic

end

Already the Formtastic gem includes a generator which can be called from the command line so this would be the first non default entry optionally invoked by the generator.

Do others here consider this feature worthwhile, something worth taking the effort to patch? A show of hands (or +1s) would be greatly appreciated. Better yet would be volunteers willing to work alongside me making this patch happen.

Jack

Comments and changes to this ticket

  • José Valim

    José Valim November 29th, 2010 @ 11:28 AM

    • State changed from “new” to “invalid”
    • Importance changed from “” to “Low”

    Rails already supports this and simple_form makes use of this feature. It just copies a file at lib/templates/erb/scaffold/_form.html.erb and generator will pick it up. This is a great solution because it even allows you to customize it for application specific logic.

    In simple form, you just need to do: rails g simple_form:install

  • klkk

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages