Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

in options_from_collection_for_select: text/value_method are chainable

#890

options_from_collection_for_select(City.all, "id", ["name", "humanize"])

I need this behaviour in my application, since the name fields are downcased and could contain _ too, I wanted to call "humanize" before outputting them. Of course you can chain as many methods as you want together.

I wrote a patch (my first patch, I hope I've done it right) to support this, I hope some of you find this useful. I also hope you understand my English.

Reported by nosilume · August 23rd, 2008 @ 11:57 PM

State: stale
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. josh
    josh
    • State changed from new to stale

    November 25th, 2008 @ 04:08 PM