store_helper.rb from crlove at Krugle
Show store_helper.rb syntax highlighted
module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes["style"] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
def format_price(amount)
dollars, cents = amount.divmod(100)
sprintf("$%d.%02d", dollars, cents)
end
end
See more files for this project here