Files
grecia/app/views/admin/homepage/_setting.html.erb
Javi Martín 5bf968d2b2 Don't use confirm dialog in admin homepage form
In this case the confirmation dialog isn't really necessary since the
action to enable/disable the setting can easily be undone.

Furthermore, these tests were failing with Chrome 83, probably because
we use `confirm_dialog` and then we use `visit` without checking the
page in between.

In theory we shouldn't need to check the page in between because the
request generated by `confirm_dialog` is a synchronous one and so
`visit` isn't executed after the previous request has finished, but
apparently this behavior has changed in Chrome 83.

We could add an expectation before executing the `visit` method, but
that wouldn't improve the usability of the application.
2020-05-25 19:28:16 +02:00

11 lines
412 B
Plaintext

<div id="<%= dom_id(setting) %>">
<%= form_for(setting, url: admin_setting_path(setting), method: :put) do |f| %>
<%= f.hidden_field :value,
value: (setting.enabled? ? "" : "active") %>
<%= f.submit(t("admin.settings.index.features.#{setting.enabled? ? "disable" : "enable"}"),
class: "button #{setting.enabled? ? "hollow alert" : "success"}") %>
<% end %>
</div>