PullMonkey Blog

17 Nov

Formgen 0.3.0 and some generated examples

Formgen generates views in erb and haml based on these keywords: has_many, belongs_to, accepts_nested_attributes_for, and has_attached_file. It follows best practice and standard patterns so you don't have to. Here is example of its usage:

Doing this

rails generate skizmo:form Foo

Generates this







That's it:

Ok, so I say that, but there are a few things to note. First, this probably only works with Rails 3, given some of the calls I make for figuring things out. Next, you'll want to yield :head, somewhere in your layout so that the content_for :head that loads the add and remove jQuery will be useful. Finally, you should note that the nested attributes are only processed from the first level, but that will soon change. Anyway, enjoy it and if you have any problems, just let me know.

Filed under: Uncategorized

Sorry, comments for this entry are closed at this time.