add validation to catch empty descriptions

This commit is contained in:
Reinier Balt 2010-07-16 13:11:01 +02:00
parent 6e5057138d
commit abf4524679
6 changed files with 56 additions and 5 deletions

View file

@ -169,7 +169,13 @@ class TodosController < ApplicationController
@projects = current_user.projects.find(:all) if @new_project_created
@initial_context_name = params['default_context_name']
@initial_project_name = params['default_project_name']
@default_tags = @todos[0].project.default_tags unless @todos[0].project.nil?
if @todos.size > 0
@default_tags = @todos[0].project.default_tags unless @todos[0].project.nil?
else
@multiple_error = "You need to submit at least one next action"
@saved = false;
@default_tags = current_user.projects.find_by_name(@initial_project_name).default_tags unless @initial_project_name.blank?
end
render :action => 'create_multiple'
end
format.xml do