generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix 'Calculator' page reverting after changing locale (#928)
* fix refreshing new calculator after changing locale * fix request mismatching * add js-redirection * fix rubocop * fix test * use inline script * add CSP * fix redirection and check tests * update csp * fix rubocop * fix turbo_stream create * add partial into shared * turbo solution * remove redundant code * fix tests
- Loading branch information
1 parent
bbb06b3
commit fd68b5b
Showing
4 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
<div class="container"> | ||
<%= simple_form_for @calculator, url: account_calculators_path do |f| %> | ||
<div class="form-group row"> | ||
<div class="my-auto col-12 has-float-label"> | ||
<%= f.input :name, class: 'form-control' %> | ||
</div> | ||
</div> | ||
<div class="button-group d-flex"> | ||
<%= f.button :submit, t('.create_calculator_button'), class: 'btn btn-green me-2 height-auto w-auto' %> | ||
<%= link_to account_calculators_path, class: 'btn btn-danger d-flex align-items-center justify-content-center height-auto w-auto' do %> | ||
<span><%= t('buttons.cancel') %></span> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<%= render "account/calculators/partials/new/form", calculator: @calculator %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<%= turbo_stream.replace( | ||
dom_id(@calculator, :form), | ||
partial: "account/calculators/partials/new/form", | ||
locals: {calculator: @calculator}) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%= simple_form_for calculator, url: account_calculators_path, html: { id: dom_id(calculator, :form) } do |f| %> | ||
<div class="form-group row"> | ||
<div class="my-auto col-12 has-float-label"> | ||
<%= f.input :name, class: 'form-control' %> | ||
</div> | ||
</div> | ||
<div class="button-group d-flex"> | ||
<%= f.button :submit, t('account.calculators.new.create_calculator_button'), class: 'btn btn-green me-2 height-auto w-auto' %> | ||
<%= link_to account_calculators_path, class: 'btn btn-danger d-flex align-items-center justify-content-center height-auto w-auto' do %> | ||
<span><%= t('buttons.cancel') %></span> | ||
<% end %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters