From f9554c7b7b3e361ec9fb6fa9b407e319fb7b0da2 Mon Sep 17 00:00:00 2001 From: Chap Ambrose Date: Wed, 7 Jul 2010 18:54:42 -0400 Subject: [PATCH] Slight change necessary to questions#create to allow for nil ideas (photocracy) --- app/controllers/questions_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index ea451d9..213dd11 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -83,7 +83,14 @@ class QuestionsController < InheritedResources::Base def create logger.info "all params are #{params.inspect}" logger.info "vi is #{params['question']['visitor_identifier']} and local are #{params['question']['local_identifier']}." - if @question = current_user.create_question(params['question']['visitor_identifier'], :name => params['question']['name'], :local_identifier => params['question']['local_identifier'], :information => params['question']['information'], :ideas => (params['question']['ideas'].lines.to_a.delete_if {|i| i.blank?})) + if @question = + current_user.create_question( + params['question']['visitor_identifier'], + :name => params['question']['name'], + :local_identifier => params['question']['local_identifier'], + :information => params['question']['information'], + :ideas => (params['question']['ideas'].lines.to_a.delete_if {|i| i.blank?} rescue nil) + ) respond_to do |format| format.xml { render :xml => @question.to_xml} end -- libgit2 0.21.2