diff --git a/app/controllers/oodle/questions_controller.rb b/app/controllers/oodle/questions_controller.rb index 263614d..e237476 100644 --- a/app/controllers/oodle/questions_controller.rb +++ b/app/controllers/oodle/questions_controller.rb @@ -14,7 +14,7 @@ def show # GET /questions/new def new @question = Question.new - @questionnaire = Questionnaire.find(params[:questionnaire_id]) + # @questionnaire = Questionnaire.find(params[:questionnaire_id]) end # GET /questions/1/edit def edit @@ -22,13 +22,13 @@ def edit # POST /questions def create - @questionnaire = Questionnaire.find(params[:questionnaire_id]) - @question = @questionnaire.questions.new(question_params) + # @questionnaire = Questionnaire.find(params[:questionnaire_id]) + @question = Question.new(question_params) respond_to do |format| if @question.save - format.html { redirect_to @questionnaire, notice: "Question was successfully created." } - format.json { render :show, status: :created, location: @questionnaire } + format.html { redirect_to @question, notice: "Question was successfully created." } + format.json { render :show, status: :created, location: @question } else format.html { render :new, status: :unprocessable_entity } format.json { render json: @question.errors, status: :unprocessable_entity }