From 7dcb5e8d891cecc219935da964321a61ba4de73f Mon Sep 17 00:00:00 2001 From: f Date: Fri, 24 Jul 2020 15:03:13 -0300 Subject: [PATCH] =?UTF-8?q?no=20fallar=20al=20ir=20a=20un=20art=C3=ADculo?= =?UTF-8?q?=20despu=C3=A9s=20de=20crearlo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/posts_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 07017d3..03b8b20 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -54,8 +54,9 @@ class PostsController < ApplicationController service = PostService.new(site: @site, usuarie: current_usuarie, params: params) + @post = service.create - if (@post = service.create.persisted?) + if @post.persisted? @site.touch redirect_to site_post_path(@site, @post)