Hello fellow railists,
i have recently used the built in number_to_currency function for ruby
on rails to convert my figures in to “£”. I have this function in my
show.rhtml which is:
Price: <%= number_to_currency(@sale.price,
{:unit => “£”, :separator => “.”, :delimiter => “,”}) %>
<% end %>
I want this to be in my list.rhtml so that all the prices can be listed
as £0.00 etc but i have used scaffold to create this and I am only new
to rails so i need help to use the above code in list.rhtml, here is the
list.rhtml code can some one please help me and place the code some
where here to make it work many thanks nish…
h1>Listing sales
<%= column.human_name %> | <% end %>|||
---|---|---|---|
<%=h sale.send(column.name) %> | <% end %><%= link_to 'Show', :action => 'show', :id => sale %> | <%= link_to 'Edit', :action => 'edit', :id => sale %> | <%= link_to 'Destroy', { :action => 'destroy', :id => sale }, :confirm => 'Are you sure?', :method => :post %> |
<%= link_to ‘Previous page’, { :page => @sale_pages.current.previous }
if @sale_pages.current.previous %>
<%= link_to ‘Next page’, { :page => @sale_pages.current.next } if
@sale_pages.current.next %>
<%= link_to ‘New sale’, :action => ‘new’ %>