Skip to content
Browse files

show original movie title in HTML title

  • Loading branch information...
1 parent 84dbfb8 commit 9442e8b5968e0ff0ca32ab06a5b3fc5f35d51425 @mislav committed
Showing with 4 additions and 3 deletions.
  1. +3 −2 app/helpers/movies_helper.rb
  2. +1 −1 app/views/movies/show.html.erb
View
5 app/helpers/movies_helper.rb
@@ -32,8 +32,9 @@ def movie_elsewhere(movie)
links
end
- def movie_title_with_year(movie)
- str = movie.title
+ def movie_title_with_year(movie, original = false)
+ str = original && movie.original_title
+ str ||= movie.title
str += " (#{movie.year})" unless movie.year.blank?
str
end
View
2 app/views/movies/show.html.erb
@@ -1,5 +1,5 @@
<% body_class 'movie-show' %>
-<% @title = movie_title_with_year(@movie) %>
+<% @title = movie_title_with_year(@movie, :with_original) %>
<article class="movie">
<%= movie_poster(@movie, :medium) %>

0 comments on commit 9442e8b

Please sign in to comment.
Something went wrong with that request. Please try again.