Skip to content

Commit

Permalink
Friendly error message when no posts
Browse files Browse the repository at this point in the history
  • Loading branch information
veezus committed Feb 27, 2009
1 parent 0402fa5 commit bedc849
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions app/views/myspot/posts/index.html.haml
Expand Up @@ -4,17 +4,23 @@

.span-715.box_white
= render :partial => "myspot/dashboard_nav"
%table
%tr
%th Pitch
%th Title
%th Actions
- @posts.each do |post|
- if @posts.blank?
%p
You haven't made any blog posts yet. Visit the
= link_to 'My Pitches', myspot_pitches_path
page to make one.
- else
%table
%tr
%td.pitch
= link_to image_tag(post.pitch.featured_image.url(:thumb)), pitch_url(post.pitch)
= link_to post.pitch.headline, pitch_url(post.pitch)
%td= link_to post.title, pitch_post_url(post.pitch, post)
%td
= link_to 'Edit', edit_pitch_post_url(post.pitch, post)
= link_to 'Delete', pitch_post_url(post.pitch, post), :method => :delete, :confirm => "Are you sure you want to delete this blog post?"
%th Pitch
%th Title
%th Actions
- @posts.each do |post|
%tr
%td.pitch
= link_to image_tag(post.pitch.featured_image.url(:thumb)), pitch_url(post.pitch)
= link_to post.pitch.headline, pitch_url(post.pitch)
%td= link_to post.title, pitch_post_url(post.pitch, post)
%td
= link_to 'Edit', edit_pitch_post_url(post.pitch, post)
= link_to 'Delete', pitch_post_url(post.pitch, post), :method => :delete, :confirm => "Are you sure you want to delete this blog post?"

0 comments on commit bedc849

Please sign in to comment.