redirigir a la lista con idioma

This commit is contained in:
f 2021-05-10 15:18:04 -03:00
parent cf01fb700c
commit 9d91323f49
2 changed files with 8 additions and 8 deletions

View file

@ -120,7 +120,7 @@ class PostsController < ApplicationController
# TODO: Notificar si se pudo o no # TODO: Notificar si se pudo o no
service.destroy service.destroy
site.touch site.touch
redirect_to site_posts_path(site) redirect_to site_posts_path(site, locale: post.locale.value)
end end
# Reordenar los artículos # Reordenar los artículos
@ -133,7 +133,7 @@ class PostsController < ApplicationController
service.reorder service.reorder
site.touch site.touch
redirect_to site_posts_path(site) redirect_to site_posts_path(site, locale: site.default_locale)
end end
# Devuelve el idioma solicitado a través de un parámetro, validando # Devuelve el idioma solicitado a través de un parámetro, validando

View file

@ -23,7 +23,7 @@ class SitesController < ApplicationController
def show def show
authorize site authorize site
redirect_to site_posts_path(site) redirect_to site_posts_path(site, locale: site.default_locale)
end end
def new def new
@ -40,7 +40,7 @@ class SitesController < ApplicationController
params: site_params) params: site_params)
if (@site = service.create).persisted? if (@site = service.create).persisted?
redirect_to site_posts_path(@site) redirect_to site_posts_path(@site, locale: @site.default_locale)
else else
render 'new' render 'new'
end end
@ -49,7 +49,7 @@ class SitesController < ApplicationController
def edit def edit
authorize site 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) breadcrumb 'sites.edit', site_path(site)
SiteService.new(site: site).build_deploys SiteService.new(site: site).build_deploys
@ -62,7 +62,7 @@ class SitesController < ApplicationController
usuarie: current_usuarie) usuarie: current_usuarie)
if service.update.valid? if service.update.valid?
redirect_to site_posts_path(site) redirect_to site_posts_path(site, locale: site.default_locale)
else else
render 'edit' render 'edit'
end end
@ -74,7 +74,7 @@ class SitesController < ApplicationController
# XXX: Convertir en una máquina de estados? # XXX: Convertir en una máquina de estados?
DeployJob.perform_async site.id if site.enqueue! 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 end
def reorder_posts def reorder_posts
@ -94,7 +94,7 @@ class SitesController < ApplicationController
flash[:danger] = I18n.t('errors.posts.reorder') flash[:danger] = I18n.t('errors.posts.reorder')
end end
redirect_to site_posts_path(site) redirect_to site_posts_path(site, locale: site.default_locale)
end end
def fetch def fetch