Beautiful button group toggles with rails, bootstrap 3 and haml

Donnerstag, 03. Dezember 2015, 08:19 Uhr | roberto@vasquez-angel.de |

.btn-group{ role: :group }
  - if item.published?
    %button.btn.btn-secondary.btn-xs.disabled{ type: :button }
      %span.glyphicon.glyphicon-eye-open
    %button.btn.btn-xs.btn-disabled
      %span.glyphicon.glyphicon-ok
    = link_to(toggle_published_item_path(item), class: 'btn btn-xs btn-danger', method: :post, title: t('.unpublish')) do
      %span.glyphicon.glyphicon-eye-close
  - else
    = link_to(toggle_published_item_path(item), class: 'btn btn-xs btn-success', method: :post, title: t('.publish')) do
      %span.glyphicon.glyphicon-eye-open
    %button.btn.btn-xs.btn-disabled
      %span.glyphicon.glyphicon-remove
    %button.btn.btn-secondary.btn-xs.disabled{ type: :button }
      %span.glyphicon.glyphicon-eye-close