开发者

Where should I put this code?

开发者 https://www.devze.com 2023-01-13 08:05 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消