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)