From 922f671114f7d6756212d289ccb462b01808b44b Mon Sep 17 00:00:00 2001 From: f Date: Mon, 22 Apr 2019 16:50:14 -0300 Subject: [PATCH] =?UTF-8?q?mostrar=20otro=20mensaje=20cuando=20la=20ficha?= =?UTF-8?q?=20est=C3=A1=20incompleta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/posts_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 2b9ad02..aba3e4e 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -62,7 +62,12 @@ class PostsController < ApplicationController @post.update_attributes(author: current_user.username) unless @post.author if @post.save - flash[:success] = @site.config.dig('thanks') + if @post.incomplete? + flash[:info] = @site.config.dig('incomplete') + else + flash[:success] = @site.config.dig('thanks') + end + redirect_to site_posts_path(@site, lang: @lang) else @invalid = true