%h1 Listing campaigns

%table.table
  %tr
    %th
    %th Name
    %th Description
    %th Game master
    %th
    %th
    %th

  - @campaigns.each do |campaign|
    %tr
      %td
        - unless campaign.users.include? current_user
          = link_to 'Join', join_campaign_path(campaign), class: 'btn btn-primary'
      %td= campaign.name
      %td= campaign.description
      %td= campaign.game_master
      %td= link_to 'Show', campaign
      - if current_user == campaign.game_master
        %td= link_to 'Edit', edit_campaign_path(campaign)
        %td= link_to 'Destroy', campaign, :method => :delete, :data => { :confirm => 'Are you sure?' }
      - else
        %td
        %td

%br

= link_to 'New Campaign', new_campaign_path

%h1 Listing campaigns

%table.table
  %tr
    %th
    %th Name
    %th Description
    %th Game master
    %th

  - @campaigns.each do |campaign|
    %tr
      %td
        - unless campaign.users.include? current_user
          = link_to 'Join', join_campaign_path(campaign), class: 'btn btn-primary'
      %td= campaign.name
      %td= campaign.description
      %td= campaign.game_master

      %td
        .btn-group
          = link_to 'Show', campaign, class: 'btn btn-default'
          - if current_user == campaign.game_master
            = link_to 'Edit', edit_campaign_path(campaign), class: 'btn btn-primary'
            = link_to 'Destroy', campaign, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'

%br

= link_to 'New Campaign', new_campaign_path

Add buttons in campaigns index
Add buttons in campaigns index
