Last active
August 29, 2015 14:06
-
-
Save senny/a2542277a78d8c4acf8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PhotosController < ApplicationController | |
def show | |
if params.has_key? :time | |
@main_photo = "http://www.google.com/images/srpr/logo11w.png" | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def i18n_image(path) | |
"#{path}.#{I18n.locale}" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Photos#show</h1> | |
<p>Find me in app/views/photos/show.html.erb</p> | |
<%= i18n_image "intro" %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Photos#show</h1> | |
<p>Find me in app/views/photos/show.html.erb</p> | |
<img src="<%= @main_photo %>" /> | |
<%= link_to photo_path time: "20140820-1800" do %> | |
- 1 hour | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment