I building a administration interface via ActiveAdmin. I have some resources like Products, at the Products i have an Article, Title, Description and Price columns. Everything working well, but i have a little problem, at the Price column i use helper number_to_currency, by default ActiveAdmin display currency as USD. I want to display prices in local currency, so and here i have a question how to implement this helper to display price in local currency (for example FR, AUD or RUB).
Rails 4.1.0
ActiveAdmin 1.0.0
ruby 2.1
app/admin/product.rb
ActiveAdmin.register Product do
# Permitted parameters
permit_params :article_id, :title, :description, :price
# Displayed columns
index do
column :article, :sortable => :article
column :title
column :description
# Currency helper
column :price, :sortable => :price do |cur|
number_to_currency cur.price
end
default_actions
end
end
app/models/product.rb
class Product < ActiveRecord::Base
# Relationship
belongs_to :article
# Validations
validates :article, :title, :description, :price, :presence => true
end