Files
nairobi/app/components/subscriptions/edit_component.html.erb
taitus 6d9e4a9330 Allow users to manage their notifications
The user can access this page without being logged in.
We identify the user through the "subscriptions_token" parameter and
show a list of the notifications that can be enable/disable.

We will return a 404 error in case someone accesses the page with a
non-existent token.

We also control the case that some anonymous user tries to access the
page without any token, by returning the CanCan::AccessDenied exception.
2022-01-21 18:58:38 +01:00

14 lines
545 B
Plaintext

<main class="subscriptions-edit">
<%= form_for user, url: subscriptions_path(token: user.subscriptions_token) do |f| %>
<h2><%= t("account.show.notifications") %></h2>
<div><%= f.check_box :email_on_comment %></div>
<div><%= f.check_box :email_on_comment_reply %></div>
<div><%= f.check_box :newsletter %></div>
<div><%= f.check_box :email_digest %></div>
<div><%= f.check_box :email_on_direct_message %></div>
<%= f.submit t("account.show.save_changes_submit"), class: "button margin-top" %>
<% end %>
</main>