PullMonkey Blog

16 Nov

Form Gen - ruby on rails gem

I've always dreaded doing the view code for nested attributes, setting up the helpers, the javascript, partials etc. Just so tedious, so I thought, I'd try my hand at a form generator. This generator takes a class and then processes all the nested attributes of that class's has_many's and belongs_to's to generate the typical pattern of form partial and field partials you find here.

Yah I did ruby syntax-highlighting ... so not the best for something like that, but eh ... it'll do.

The formgen gem is a 0.1.0 starting point, but has worked for all the things I've needed. If you're feeling brave give it a shot:

# In your Gemfile -
gem 'formgen'
# then from your rails projects -
rails g skizmo:form SomeClass

That outta do it.

Filed under: Uncategorized

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