Topic: Custom Select Helpers

I tried to get a bit clever today, refactoring this

form.collection_select(:kind, Link::Kind.constants, :title, :title, {},:onchange =>"jsStuff();", :index => nil)

to this

form.select_kind(Link::Kind.constants,{:onchange =>"jsStuff();"})

with a custom helper


def select_kind(kinds, options={}, html_options={})
  collection_select(:kind, kinds, :title, :title, options={}, html_options={})

which gives me

undefined method `select_kind' for #<ActionView::Helpers::FormBuilder:0x34178c0>


Re: Custom Select Helpers

It's because you are calling it on the form object wink
I really dunno how to code it so it supports it so you'll need to wait for someone with a solution.