Closed klebershimabuku closed 13 years ago
Hi there, it would help if you would give file-line-nr where the error happened.
But anyway, when using on_the_spot_edit
, the second parameter always needs to be the fieldname.
If you want to change what is shown, you can do write something like:
<%= on_the_spot_edit part_type, :quotation, :display_text => number_to_currency(:quotation) %>
But I am not sure if converting the currency back to number will work, when saving it to the controller. You might need to use your own method to convert the currency back to number correctly.
You right, I will need to create a method to convert the saved number (decimal) to display correctly.
I don't know if it's the right way for doing this, but I just created a helper method and did the convert to display as string and it worked.
Thank you for your support.
Ok. Great you found a solution.
Hi,
I'm trying to use the method number_to_currency but it looks like have no support for it until now.
Thats the way I'm doing:
<% @part_types.each do |part_type| %>
<% end %>
The error I get is:
Undefined method "to_f"
Just doing:
number_to_currency(part_type.quotation)
works fine.