This project is archived and is in readonly mode.

#1374 ✓wontfix
Lucas Carlson

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

Reported by Lucas Carlson | November 14th, 2008 @ 09:02 AM | in 2.x

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)}" />

Comments and changes to this ticket

  • Pratik

    Pratik March 7th, 2009 @ 03:29 PM

    • 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 !

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Tags

Pages