Skip to content

Instantly share code, notes, and snippets.

@senny
Last active August 29, 2015 14:06
Show Gist options
  • Save senny/a2542277a78d8c4acf8f to your computer and use it in GitHub Desktop.
Save senny/a2542277a78d8c4acf8f to your computer and use it in GitHub Desktop.
class PhotosController < ApplicationController
def show
if params.has_key? :time
@main_photo = "http://www.google.com/images/srpr/logo11w.png"
end
end
end
module ApplicationHelper
def i18n_image(path)
"#{path}.#{I18n.locale}"
end
end
<h1>Photos#show</h1>
<p>Find me in app/views/photos/show.html.erb</p>
<%= i18n_image "intro" %>
<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