From 9d91323f496f31599696656a84cddda15c2c1ff0 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 10 May 2021 15:18:04 -0300 Subject: [PATCH] redirigir a la lista con idioma --- app/controllers/posts_controller.rb | 4 ++-- app/controllers/sites_controller.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 225b0c3..c578e94 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 f3114d9..d221628 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