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.

Adding a :cast option to text_field in order to facilitate displaying data in a form in a more human friendly form

#1374

Adding a :cast option to text_field in order to facilitate displaying data in a form in a more human friendly form.

For example:

text_field(:shopping_cart, :price, :cast => lambda {|v| number_to_currency v})

=> <input type="text" id="shopping_cart_price" name="shopping_cart[price]" value="#{number_to_currency(@shopping_cart.price)}" />

Reported by Lucas Carlson · November 14th, 2008 @ 09:02 AM

State: wontfix
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • Assigned user set to Pratik
    • Tag set to patch
    • State changed from new to wontfix

    I don't think this belongs to core. You could just use a custom form builder or a custom helper. But if we have more votes, can reconsider.

    Thanks !

    March 7th, 2009 @ 03:29 PM