Use `button_to` instead of `link_to` for post in service settings

This commit is contained in:
Karina Kwiatek 2022-01-15 17:37:44 +01:00 committed by Karina Kwiatek
parent 75b93d3535
commit f13e84319e
1 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@
- APP_CONFIG['sharing'].each do |service, service_options|
- if service_options['enabled'] && @services.none? { |x| x.provider == service.to_s }
%p= link_to t('views.settings.service.connect', service: service.capitalize), "/auth/#{service}", method: :post
%p= button_to t('views.settings.service.connect', service: service.capitalize), "/auth/#{service}", method: :post, class: 'btn btn-info'
- if @services.count.positive?
%ul.list-group
@ -16,10 +16,12 @@
%i{ class: "fa fa-#{service.provider}" }
%strong= service.provider.capitalize
(#{service.nickname})
= link_to t('views.settings.service.disconnect'),
= button_to t('views.settings.service.disconnect'),
service_path(service),
data: { confirm: t('views.settings.service.confirm', service: service.provider.capitalize) },
method: :delete
method: :delete,
class: 'btn btn-link',
form: { class: 'd-inline' }
.col-md-6.mt-2
= bootstrap_form_for(service, as: 'service', url: update_service_path(service)) do |f|