Where should I put this code?
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
开发者_StackOverflow中文版any suggestions
Check out the discussion here.
精彩评论