diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 225b0c36..c578e944 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -120,7 +120,7 @@ class PostsController < ApplicationController # TODO: Notificar si se pudo o no service.destroy site.touch - redirect_to site_posts_path(site) + redirect_to site_posts_path(site, locale: post.locale.value) end # Reordenar los artículos @@ -133,7 +133,7 @@ class PostsController < ApplicationController service.reorder site.touch - redirect_to site_posts_path(site) + redirect_to site_posts_path(site, locale: site.default_locale) end # Devuelve el idioma solicitado a través de un parámetro, validando diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index f3114d9a..d221628e 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -23,7 +23,7 @@ class SitesController < ApplicationController def show authorize site - redirect_to site_posts_path(site) + redirect_to site_posts_path(site, locale: site.default_locale) end def new @@ -40,7 +40,7 @@ class SitesController < ApplicationController params: site_params) if (@site = service.create).persisted? - redirect_to site_posts_path(@site) + redirect_to site_posts_path(@site, locale: @site.default_locale) else render 'new' end @@ -49,7 +49,7 @@ class SitesController < ApplicationController def edit authorize site - breadcrumb site.title, site_posts_path(site), match: :exact + breadcrumb site.title, site_posts_path(site, locale: site.default_locale), match: :exact breadcrumb 'sites.edit', site_path(site) SiteService.new(site: site).build_deploys @@ -62,7 +62,7 @@ class SitesController < ApplicationController usuarie: current_usuarie) if service.update.valid? - redirect_to site_posts_path(site) + redirect_to site_posts_path(site, locale: site.default_locale) else render 'edit' end @@ -74,7 +74,7 @@ class SitesController < ApplicationController # XXX: Convertir en una máquina de estados? DeployJob.perform_async site.id if site.enqueue! - redirect_to site_posts_path(site) + redirect_to site_posts_path(site, locale: site.default_locale) end def reorder_posts @@ -94,7 +94,7 @@ class SitesController < ApplicationController flash[:danger] = I18n.t('errors.posts.reorder') end - redirect_to site_posts_path(site) + redirect_to site_posts_path(site, locale: site.default_locale) end def fetch