AutoCommit Fre Aug 7 01:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-07 01:03:02 +02:00
parent c6222cdc23
commit 13283e0e65
8 changed files with 26 additions and 7 deletions

View File

@@ -31,7 +31,9 @@ class Survey::QuestionsController < ApplicationController
# GET /survey/questions/1.json
def create_from_template
@template = Survey::Question.find(params[:id])
parent= params[:parent_type].constantize.find(params[:parent_id])
@survey_question = @template.copy_from_template_for(parent)
render action: :show
end
def show
@@ -46,7 +48,8 @@ class Survey::QuestionsController < ApplicationController
# GET /survey/questions/new.json
def new
@survey_question = Survey::Question.new
@commentable=params[:commentable_type].constantize.find(params[:commentable_id])
@parent=params[:parent_type].constantize.find(params[:parent_id])
@survey_question.parent=@parent
respond_to do |format|
format.html # new.html.erb
end