Skip to content

Commit

Permalink
Redirct to current page params after update
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaeftekhar committed Jan 3, 2024
1 parent abbf0c6 commit 46c481d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ def update
current_organization: current_organization,
translation_set: set
)
page_param = params[:translation][:page]

UpdateTranslation.call(@form, translation) do
on(:ok) do
flash[:notice] = I18n.t("translations.update.success", scope: "decidim.term_customizer.admin")
redirect_to translation_set_translations_path(set)
redirect_to translation_set_translations_path(set, page: page_param)
end

on(:invalid) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
<div class="row column">
<%= form.translated :text_area, :value, rows: 4 %>
</div>
<%= form.hidden_field :page, value: params[:page] %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</td>
<td class="table-list__actions">
<% if allowed_to? :update, :translation, translation: translation %>
<%= icon_link_to "pencil", edit_translation_set_translation_path(set, translation), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
<%= icon_link_to "pencil", edit_translation_set_translation_path(set, translation, page: params[:page]), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
<% end %>

<% if allowed_to? :destroy, :translation, translation: translation %>
Expand Down

0 comments on commit 46c481d

Please sign in to comment.