a huge beanie is approaching fast 1

Posted by s.f. on November 25, 2008

In Rails, one form helper(well, besides a broken date_select) stands alone as cruel, sadistic, and impossible-to-please with just a simple hash. That form helper’s name: option_groups_from_collection_for_select.

It’s so painful that most people would re-implement it, rather than fall victim to its NoMethodError wails. But that’s not the path for us. When you’re using something like Base Without Table to clean up your email contact forms, you don’t have time to mess around with o_g_f_c_f_s’ hunger for has_many. That’s when you pull out OpenStruct, and cleave the beast in twain.

pointy_group.rb:

pointy_view.html.erb:

Standard disclaimers apply. Enterprising developers can probably spot the limitation, although it’s probably not hard to pave over it if you need to.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. Scott Robinson Wed, 26 Nov 2008 00:51:30 EST

    Hawt.

Comments