Allow redirect to remote census configuration tab

Currently after each update of any Settings is redirected to the first
tab by default.
As this new tab remote_census_configuation has a lot of fields to fill
in it is a bit uncomfortable to have to go back to the tab after each
update.

- Add hidden field :tag to set current tag value
- After update add tag value to request.referer
- To avoid errors when partial call has not param :tag, add the "define?"
  method on hidden_field value.
This commit is contained in:
taitus
2019-04-10 15:00:13 +02:00
committed by Javi Martín
parent 37f20198da
commit ca0979bd45
5 changed files with 47 additions and 5 deletions

View File

@@ -19,7 +19,11 @@
<% if setting.content_type? %>
<%= render "admin/settings/content_types_settings_form", setting: setting %>
<% else %>
<%= render "admin/settings/settings_form", setting: setting %>
<% if defined?(tab) %>
<%= render "admin/settings/settings_form", setting: setting, tab: tab %>
<% else %>
<%= render "admin/settings/settings_form", setting: setting %>
<% end %>
<% end %>
</td>
</tr>