no fallar al ir a un artículo después de crearlo
This commit is contained in:
parent
37e46af665
commit
7dcb5e8d89
1 changed files with 2 additions and 1 deletions
|
@ -54,8 +54,9 @@ class PostsController < ApplicationController
|
||||||
service = PostService.new(site: @site,
|
service = PostService.new(site: @site,
|
||||||
usuarie: current_usuarie,
|
usuarie: current_usuarie,
|
||||||
params: params)
|
params: params)
|
||||||
|
@post = service.create
|
||||||
|
|
||||||
if (@post = service.create.persisted?)
|
if @post.persisted?
|
||||||
@site.touch
|
@site.touch
|
||||||
|
|
||||||
redirect_to site_post_path(@site, @post)
|
redirect_to site_post_path(@site, @post)
|
||||||
|
|
Loading…
Reference in a new issue