Skip to content

Instantly share code, notes, and snippets.

@osiro
Created June 12, 2014 08:24
Show Gist options
  • Save osiro/79686a50244970f42fe2 to your computer and use it in GitHub Desktop.
Save osiro/79686a50244970f42fe2 to your computer and use it in GitHub Desktop.
- # TODO add in data for project creator (John Smith) and location (Perth, WA)
.project-tiles
.recent-projects
- if projects.count(:all) > 0 # just "count" raises an exception: https://github.com/Casecommons/pg_search/issues/127
- projects.each do |project|
%article.project{ data: { project: { id: project.id } } }
.project-thumbnail
= link_to project_path(project) do
= image_tag(project.thumbnail.url)
.project-details
= link_to project_path(project) do
%h3= truncate(project.title, length: 50)
.creator
= link_to 'John Smith', "#"
%p= truncate(project.description, length: 100)
%span.location Perth, WA
- else
.general-message
%h3 Sorry, no projects found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment