Skip to content

Commit

Permalink
Fix typos that prevented to display a single photo project
Browse files Browse the repository at this point in the history
  • Loading branch information
oakho committed Sep 16, 2012
1 parent 9874a4b commit 13a73fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/controllers/photos.rb
Expand Up @@ -20,13 +20,13 @@

get :index do
@title = "Here's some photos I took"
@projects = Project.find_by_category_name("Photos")
@photos = Project.find_by_category_name("Photos")
render 'photos/index'
end

get :index, with: :slug do
@project = Project.find_by_slug(params[:slug])
@title = @project.name
render 'projects/show'
@photo = Project.find_by_slug(params[:slug])
@title = @photo.name
render 'photos/show'
end
end
2 changes: 1 addition & 1 deletion app/views/photos/index.erb
@@ -1,6 +1,6 @@
<div class="photos row">
<% unless @photos.nil? %>
<% @projects.each do |photo| %>
<% @photos.each do |photo| %>
<a class="a-photo-cover" href="/photos/<%= photo.slug %>">
<h3 class="heading2"><%= photo.name %></h3>
<div class="a-photo-cover-normal">
Expand Down
8 changes: 4 additions & 4 deletions app/views/photos/show.erb
@@ -1,6 +1,6 @@
<div class="project row" itemscope itemtype="http://schema.org/Thing">
<aside class="project-attachments">
<% @project.attachments.each do |attachment| %>
<% @photo.attachments.each do |attachment| %>
<div itemscope itemtype="http://schema.org/ImageObject">
<img src="<%= attachment.file.thumb('640x').url %>" itemprop="contentURL" alt="<%= attachment.file.name %>">
</div>
Expand All @@ -9,12 +9,12 @@
<article class="project-infos">
<h3 class="heading2">The Project</h3>
<section class="project-body" itemprop="description">
<%= @project.body %>
<%= @photo.body %>
</section>
<% unless @project.tags.empty? %>
<% unless @photo.tags.empty? %>
<h3 class="heading2">The Technologies</h3>
<section class="project-tags">
<% @project.tags.each do |tag| %>
<% @photo.tags.each do |tag| %>
<span class="project-tag tag"><%= tag.name.capitalize %></span>
<% end %>
</section>
Expand Down
2 changes: 1 addition & 1 deletion models/project.rb
Expand Up @@ -23,7 +23,7 @@ def cover_blurred_url
end

def self.find_by_category_name(category)
category = Category.find_by_name category
category = Category.find_by_name(category)
unless category.nil?
return category.projects
end
Expand Down

0 comments on commit 13a73fc

Please sign in to comment.