Add format helper for currency
This commit is contained in:
parent
5408c08b58
commit
6cc02cb563
7 changed files with 21 additions and 9 deletions
|
|
@ -19,6 +19,11 @@ module ApplicationHelper
|
|||
I18n.l(time, :format => format) unless (time.nil? || format.nil?)
|
||||
end
|
||||
|
||||
def format_currency(amount)
|
||||
class_name = amount < 0 ? 'negative_amout' : 'positive_amount'
|
||||
content_tag :span, number_to_currency(amount), class: class_name
|
||||
end
|
||||
|
||||
# Creates ajax-controlled-links for pagination
|
||||
def pagination_links_remote(collection, options = {})
|
||||
per_page = options[:per_page] || @per_page
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue