martinisoft/funnies

View on GitHub
app/views/comics/index.html.haml

Summary

Maintainability
Test Coverage
- unless params[:username]
  #suggestion
    %h3 Comic not listed here? #{link_to "Suggest a comic", new_suggestion_path}

- if subscribed_comics.any?
  = render :partial => 'comic', comics: subscribed_comics
- elsif comics.any? && params[:username].nil?
  = render :partial => 'comic'
- else
  - if params[:username]
    - if params[:username] == current_user.username
      %h1 You are not subscribed to any comics, head over to the #{link_to "comics", comics_path} page to subscribe
    - else
      %h1 This user is not subscribing to any comics
  - else
    %h1 There are no comics currently in the system