Haml clean up for Roles views

This commit is contained in:
Brenda Wallace
2017-02-07 22:05:05 +13:00
committed by Shiny
parent acbb610e05
commit e6254da3f1
3 changed files with 8 additions and 5 deletions

View File

@@ -1,7 +1,9 @@
= form_for @role do |f|
- if @role.errors.any?
#error_explanation
%h2= "#{pluralize(@role.errors.size, "error")} prohibited this role from being saved:"
%h2
= pluralize(@role.errors.size, "error")
prohibited this role from being saved:
%ul
- @role.errors.full_messages.each do |msg|
%li= msg

View File

@@ -1,7 +1,7 @@
- content_for :title, "Listing roles"
- if can? :create, Role
%p= link_to 'New Role', new_role_path, :class => 'btn btn-primary'
%p= link_to 'New Role', new_role_path, class: 'btn btn-primary'
%table
%tr
@@ -16,6 +16,7 @@
%td= link_to role.name, role
%td= role.description
- if can? :edit, role
%td= link_to 'Edit', edit_role_path(role), :class => 'btn btn-default btn-xs'
%td= link_to 'Edit', edit_role_path(role), class: 'btn btn-default btn-xs'
- if can? :destroy, role
%td= link_to 'Delete', role, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
%td= link_to 'Delete', role, method: :delete,
data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-xs'

View File

@@ -7,6 +7,6 @@
%b Description:
= @role.description
= link_to 'Edit', edit_role_path(@role), :class => 'btn btn-default btn-xs'
= link_to 'Edit', edit_role_path(@role), class: 'btn btn-default btn-xs'
\|
= link_to 'Back', roles_path