Use relative URLs where possible

In general, we always use relative URLs (using `_path`), but sometimes
we were accidentally using absolute URLs (using `_url`). It's been
reported i might cause some isuses if accepting both HTTP and HTTPS
connections, although we've never seen the case.

In any case, this change makes the code more consistent and makes the
generated HTML cleaner.
This commit is contained in:
Javi Martín
2019-10-11 03:06:24 +02:00
parent 11e52dbe98
commit 27468b0b7b
22 changed files with 58 additions and 53 deletions

View File

@@ -5,7 +5,7 @@ class Admin::Poll::ActivePollsController < Admin::Poll::BaseController
def create
if @active_poll.update(active_poll_params)
redirect_to admin_polls_url, notice: t("flash.actions.update.active_poll")
redirect_to admin_polls_path, notice: t("flash.actions.update.active_poll")
else
render :edit
end
@@ -16,7 +16,7 @@ class Admin::Poll::ActivePollsController < Admin::Poll::BaseController
def update
if @active_poll.update(active_poll_params)
redirect_to admin_polls_url, notice: t("flash.actions.update.active_poll")
redirect_to admin_polls_path, notice: t("flash.actions.update.active_poll")
else
render :edit
end

View File

@@ -60,7 +60,7 @@ class Admin::Widget::CardsController < Admin::BaseController
if @card.site_customization_page_id
redirect_to admin_site_customization_page_cards_path(page), notice: notice
else
redirect_to admin_homepage_url, notice: notice
redirect_to admin_homepage_path, notice: notice
end
end