Skip to content

Instantly share code, notes, and snippets.

@alanmaciel
Created February 26, 2018 04:08
Show Gist options
  • Select an option

  • Save alanmaciel/0d3e703f95d282844fc3862bd4dff411 to your computer and use it in GitHub Desktop.

Select an option

Save alanmaciel/0d3e703f95d282844fc3862bd4dff411 to your computer and use it in GitHub Desktop.
module MoviesHelper
def format_total_gross(movie)
if movie.flop?
content_tag(:strong, 'Flop!')
else
number_to_currency(movie.total_gross)
end
end
def image_for(movie)
if movie.image_file_name.blank?
image_tag('placeholder.png')
else
image_tag(movie.image_file_name)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment