Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7892 (new enhancement)

Opened 1 year ago

Last modified 1 year ago

[PATCH] number_helper.rb: Added "unitside" option

Reported by: HappyCoder Assigned to: bitsweat
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Reading "Agile Web Development with Rails 2nd edition" I wondered if I could put the unit string after the number:

<span class="price"><%= number_to_currency(product.price, :unit => " kr.") %></span>

I changed a code a bit and now I can use this helper to format currency with the unit on the right side as it's intended for krones(estonian currency).

<span class="price"><%= number_to_currency(product.price, :unitside => 'right', :unit => " kr.") %></span>

Attachments

number_helper_added_unitside_option.diff (1.9 kB) - added by HappyCoder on 03/22/07 18:59:29.
number_helper_added_unitside_option_with_test.patch (2.8 kB) - added by kamal on 06/27/07 03:11:55.
adds tests for this patch, modified slightly to patch cleanly against trunk r7128

Change History

03/22/07 18:59:29 changed by HappyCoder

  • attachment number_helper_added_unitside_option.diff added.

06/25/07 19:14:26 changed by josh

  • status changed from new to closed.
  • resolution set to untested.

Needs tests for the unitside option.

06/27/07 03:11:55 changed by kamal

  • attachment number_helper_added_unitside_option_with_test.patch added.

adds tests for this patch, modified slightly to patch cleanly against trunk r7128

06/27/07 03:12:45 changed by kamal

  • status changed from closed to reopened.
  • resolution deleted.

Test added, patch now applies cleanly against trunk r7128

06/27/07 03:17:55 changed by kamal

  • owner changed from core to bitsweat.
  • status changed from reopened to new.