views:

63

answers:

1

i have this snippet that i want to access from a controller or a model but i dont know what file to put it in

def cost_to_f(string)
 string.gsub(/[\$,]/, '').to_f
end

I tried application controller and application helper and no luck on either

any suggestions

+3  A: 

Check out the discussion here.

mark