Skip to content

Commit

Permalink
Fix quesiton controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscoLegrand committed Oct 22, 2024
1 parent a6a5c2f commit b8c80c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/oodle/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ 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
end

# 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 }
Expand Down

0 comments on commit b8c80c5

Please sign in to comment.