DRY actions more

This commit is contained in:
Brenda Wallace
2019-01-24 13:46:35 +13:00
parent 79c22308df
commit fc6183eb52
3 changed files with 4 additions and 5 deletions

View File

@@ -6,8 +6,6 @@
= render partial: "layouts/header"
#maincontainer
.row
.col-md-12= render partial: "shared/flash_messages", flash: flash
.row
.col-md-6
- if content_for?(:title)
@@ -25,6 +23,7 @@
.row
.col-md-12
= render partial: "shared/flash_messages", flash: flash
= yield
%footer

View File

@@ -2,6 +2,6 @@
- if can?(:edit, @photo) && can?(:destroy, @photo)
%p
- if can?(:edit, @photo)
= render 'shared/buttons/edit', path: edit_photo_path(@photo)
= edit_button(@photo)
- if can?(:destroy, @photo)
= render 'shared/buttons/delete', path: photo_path(@photo)
= delete_button(@photo)

View File

@@ -1,4 +1,4 @@
- if can? :edit, photo
= link_to photo_associations_path(photo_id: photo.id, type: type, id: thing.id),
method: 'delete', class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-remove{ title: "Remove link" }
= delete_icon