Refactoring lodgings

This commit is contained in:
chrisbr 2014-11-12 12:00:03 +01:00
parent c0cdf3e6e5
commit 580c6c6ed9
11 changed files with 177 additions and 68 deletions

View file

@ -1,5 +1,26 @@
.row
.col-md-8
= semantic_form_for(@venue, :url => admin_conference_lodging_path(@conference.short_title, @conference.venue.lodgings), :html => {:multipart => true}) do |f|
= dynamic_association :lodgings, "Lodgings", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
%h1 Lodgings
- if @venue.lodgings.any?
.row
.col-md-12
%table.table
%thead
%th #
%th Name
%th Edit
%th Delete
%tbody
- @venue.lodgings.each_with_index do |lodging, index|
%tr
%td
= index + 1
%td
= link_to lodging.name, admin_conference_lodging_path(@conference.short_title, lodging.id)
%td
= link_to 'Edit', edit_admin_conference_lodging_path(@conference.short_title, lodging.id),
method: :get, class: 'btn btn-primary'
%td
= link_to 'Delete', admin_conference_lodging_path(@conference.short_title, lodging.id),
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the lodging #{lodging.name}?" }
= link_to 'Add Lodging', new_admin_conference_lodging_path(@conference.short_title), class: 'btn btn-success'