Sha256: 2f85c799f6004375996d8596a2593bcf9e56b198fb43b88eaa520fc4963669e8
Contents?: true
Size: 999 Bytes
Versions: 20
Compression:
Stored size: 999 Bytes
Contents
module Snaptable module Helpers module ButtonsHelper def add_button link_to t("table.buttons.add"), request.path + "/new", class: "add" end def show_button link_to t("table.buttons.show"), "#", class: "show" end def edit_button link_to t("table.buttons.edit"), "#", class: "edit" end def delete_button link_to t("table.buttons.delete"), "#", method: :delete, class: "delete", data: { confirm: "Etes-vous sûr de vouloir supprimer cette entrée ?" } end def add_button? !Snaptable.use_permission || rights?(:create, params[:controller]) end def edit_button? !Snaptable.use_permission || rights?(:update, params[:controller]) end def show_button? !Snaptable.use_permission || rights?(:read, params[:controller]) end def delete_button? !Snaptable.use_permission || rights?(:destroy, params[:controller]) end end end end
Version data entries
20 entries across 20 versions & 1 rubygems