lib/para/markup/resources_buttons.rb in para-0.11.4 vs lib/para/markup/resources_buttons.rb in para-0.12.0

- old
+ new

@@ -14,18 +14,16 @@ path = component.relation_path( resource, action: :clone, return_to: view.request.fullpath ) options = { - method: :post, class: 'btn btn-sm btn-icon-info btn-shadow hint--left', - aria: { - label: ::I18n.t('para.shared.copy') - } + data: { 'turbo-method': :post, 'turbo-frame': '_top' }, + aria: { label: ::I18n.t('para.shared.copy') } } - view.link_to(path, options) do + view.link_to(path, **options) do content_tag(:i, '', class: 'fa fa-copy') end end def edit_button(resource) @@ -33,33 +31,39 @@ path = component.relation_path( resource, action: :edit, return_to: view.request.fullpath ) - view.link_to(path, class: 'btn btn-sm btn-icon-primary btn-shadow hint--left', aria: { label: ::I18n.t('para.shared.edit') }) do + options = { + class: 'btn btn-sm btn-icon-primary btn-shadow hint--left', + data: { 'turbo-frame': '_top' }, + aria: { label: ::I18n.t('para.shared.edit') } + } + + view.link_to(path, **options) do content_tag(:i, '', class: 'fa fa-pencil') end end def delete_button(resource) return unless view.can?(:delete, resource) path = component.relation_path(resource, return_to: view.request.fullpath) options = { - method: :delete, + class: 'btn btn-sm btn-icon-danger btn-shadow hint--left', data: { - confirm: ::I18n.t('para.list.delete_confirmation') + 'turbo-method': :delete, + 'turbo-confirm': ::I18n.t('para.list.delete_confirmation') }, - class: 'btn btn-sm btn-icon-danger btn-shadow hint--left', aria: { label: ::I18n.t('para.shared.destroy') } } - view.link_to(path, options) do + view.link_to(path, **options) do content_tag(:i, '', class: 'fa fa-times') end end end end -end \ No newline at end of file +end