Commit 7e89b4a3f313b780af4f4ba515e1c322d60425fb
1 parent
8600ff27
Exists in
colab
and in
4 other branches
Replace url route helpers by path ones
Using URL helpers is not friendly with proxies like Colab. The path helpers have the same effect unless we want sometime to render pages outside Prezento context like embeds or sending emails. Signed off by: Diego Araújo <diegoamc90@gmail.com>
Showing
6 changed files
with
8 additions
and
8 deletions
Show diff stats
app/controllers/concerns/ownership_authentication.rb
| ... | ... | @@ -76,7 +76,7 @@ module OwnershipAuthentication |
| 76 | 76 | def check_reading_group_ownership(id) |
| 77 | 77 | if current_user.reading_group_attributes.find_by_reading_group_id(id).nil? |
| 78 | 78 | respond_to do |format| |
| 79 | - format.html { redirect_to reading_group_url(id: id), notice: t('not_allowed') } | |
| 79 | + format.html { redirect_to reading_group_path(id: id), notice: t('not_allowed') } | |
| 80 | 80 | format.json { head :no_content } |
| 81 | 81 | end |
| 82 | 82 | end |
| ... | ... | @@ -87,7 +87,7 @@ module OwnershipAuthentication |
| 87 | 87 | def check_kalibro_configuration_ownership(id) |
| 88 | 88 | if current_user.kalibro_configuration_attributes.find_by_kalibro_configuration_id(id).nil? |
| 89 | 89 | respond_to do |format| |
| 90 | - format.html { redirect_to kalibro_configurations_url(id: id), notice: t('not_allowed') } | |
| 90 | + format.html { redirect_to kalibro_configurations_path(id: id), notice: t('not_allowed') } | |
| 91 | 91 | format.json { head :no_content } |
| 92 | 92 | end |
| 93 | 93 | end | ... | ... |
app/views/compound_metric_configurations/edit.html.erb
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | |
| 7 | 7 | <br> |
| 8 | 8 | |
| 9 | -<%= form_for(@compound_metric_configuration, :url => kalibro_configuration_compound_metric_configuration_update_url(@compound_metric_configuration.kalibro_configuration_id, @compound_metric_configuration.id), method: :put) do |f| %> | |
| 9 | +<%= form_for(@compound_metric_configuration, :url => kalibro_configuration_compound_metric_configuration_update_path(@compound_metric_configuration.kalibro_configuration_id, @compound_metric_configuration.id), method: :put) do |f| %> | |
| 10 | 10 | <%= render partial: 'form', locals: {f: f} %> |
| 11 | 11 | <% end %> |
| 12 | 12 | ... | ... |
app/views/kalibro_ranges/edit.html.erb
| 1 | 1 | <h1><%= t_action(:edit, KalibroRange) %></h1> |
| 2 | 2 | |
| 3 | -<%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_range_update_url( | |
| 3 | +<%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_range_update_path( | |
| 4 | 4 | @kalibro_configuration_id, @metric_configuration_id, @kalibro_range.id), method: :put) do |f| %> |
| 5 | 5 | <%= render partial: 'form', locals: {f: f} %> |
| 6 | 6 | <% end %> |
| 7 | 7 | \ No newline at end of file | ... | ... |
app/views/metric_configurations/edit.html.erb
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <h1><%= t('editing_metric_configuration') %></h1> |
| 3 | 3 | </div> |
| 4 | 4 | |
| 5 | -<%= form_for(@metric_configuration, :url => kalibro_configuration_metric_configuration_update_url(@kalibro_configuration_id, @metric_configuration.id), method: :put) do |f| %> | |
| 5 | +<%= form_for(@metric_configuration, :url => kalibro_configuration_metric_configuration_update_path(@kalibro_configuration_id, @metric_configuration.id), method: :put) do |f| %> | |
| 6 | 6 | <%= render partial: 'form', locals: {f: f} %> |
| 7 | 7 | <div class="row margin-left-none" style="margin-top: 20px"> |
| 8 | 8 | <%= f.submit t('save'), class: 'btn btn-primary' %> | ... | ... |
app/views/repositories/edit.html.erb
| ... | ... | @@ -2,6 +2,6 @@ |
| 2 | 2 | <h1><%= t_action(:edit, Repository) %></h1> |
| 3 | 3 | </div> |
| 4 | 4 | |
| 5 | -<%= form_for(@repository, :url => repository_update_url(@repository.id), method: :put) do |f| %> | |
| 5 | +<%= form_for(@repository, :url => repository_update_path(@repository.id), method: :put) do |f| %> | |
| 6 | 6 | <%= render partial: 'form', locals: {f: f} %> |
| 7 | 7 | <% end %> | ... | ... |
app/views/repositories/new.html.erb
| ... | ... | @@ -3,11 +3,11 @@ |
| 3 | 3 | </div> |
| 4 | 4 | |
| 5 | 5 | <% unless @project_id.nil? %> |
| 6 | - <%= form_for(@repository, :url => project_repositories_url(@project_id)) do |f| %> | |
| 6 | + <%= form_for(@repository, :url => project_repositories_path(@project_id)) do |f| %> | |
| 7 | 7 | <%= render partial: 'form', locals: {f: f} %> |
| 8 | 8 | <% end %> |
| 9 | 9 | <% else %> |
| 10 | - <%= form_for(@repository, :url => repositories_url) do |f| %> | |
| 10 | + <%= form_for(@repository, :url => repositories_path) do |f| %> | |
| 11 | 11 | <%= render partial: 'form', locals: {f: f} %> |
| 12 | 12 | <% end %> |
| 13 | 13 | <% end %> | ... | ... |