ehmorris/cardslap

View on GitHub
app/helpers/application_helper.rb

Summary

Maintainability
A
35 mins
Test Coverage
module ApplicationHelper
  def header_deck_link
    if (defined? @share and @share.persisted?) and defined? @deck
      link_to @deck.name, deck_share_path(@deck.id, @share)
    elsif ((defined? @card and @card.persisted?) or defined? @quiz) and defined? @deck
      link_to @deck.name, deck_path(@deck)
    elsif defined? @deck
      @deck.name
    end
  end
end