AutoCommit Don Jul 30 00:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-07-30 00:03:02 +02:00
parent 068c2a2e55
commit 97df081b33
66 changed files with 1542 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
class Survey::AnswersController < ApplicationController
# GET /survey/answers
# GET /survey/answers.json
def index
@survey_answers = Survey::Answer.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @survey_answers }
end
end
# GET /survey/answers/1
# GET /survey/answers/1.json
def show
@survey_answer = Survey::Answer.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @survey_answer }
end
end
# GET /survey/answers/new
# GET /survey/answers/new.json
def new
@survey_answer = Survey::Answer.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @survey_answer }
end
end
# GET /survey/answers/1/edit
def edit
@survey_answer = Survey::Answer.find(params[:id])
end
# POST /survey/answers
# POST /survey/answers.json
def create
@survey_answer = Survey::Answer.new(params[:survey_answer])
respond_to do |format|
if @survey_answer.save
format.html { redirect_to @survey_answer, notice: 'Answer was successfully created.' }
format.json { render json: @survey_answer, status: :created, location: @survey_answer }
else
format.html { render action: "new" }
format.json { render json: @survey_answer.errors, status: :unprocessable_entity }
end
end
end
# PUT /survey/answers/1
# PUT /survey/answers/1.json
def update
@survey_answer = Survey::Answer.find(params[:id])
respond_to do |format|
if @survey_answer.update_attributes(params[:survey_answer])
format.html { redirect_to @survey_answer, notice: 'Answer was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @survey_answer.errors, status: :unprocessable_entity }
end
end
end
# DELETE /survey/answers/1
# DELETE /survey/answers/1.json
def destroy
@survey_answer = Survey::Answer.find(params[:id])
@survey_answer.destroy
respond_to do |format|
format.html { redirect_to survey_answers_url }
format.json { head :no_content }
end
end
end

View File

@@ -0,0 +1,83 @@
class Survey::ChoicesController < ApplicationController
# GET /survey/choices
# GET /survey/choices.json
def index
@survey_choices = Survey::Choice.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @survey_choices }
end
end
# GET /survey/choices/1
# GET /survey/choices/1.json
def show
@survey_choice = Survey::Choice.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @survey_choice }
end
end
# GET /survey/choices/new
# GET /survey/choices/new.json
def new
@survey_choice = Survey::Choice.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @survey_choice }
end
end
# GET /survey/choices/1/edit
def edit
@survey_choice = Survey::Choice.find(params[:id])
end
# POST /survey/choices
# POST /survey/choices.json
def create
@survey_choice = Survey::Choice.new(params[:survey_choice])
respond_to do |format|
if @survey_choice.save
format.html { redirect_to @survey_choice, notice: 'Choice was successfully created.' }
format.json { render json: @survey_choice, status: :created, location: @survey_choice }
else
format.html { render action: "new" }
format.json { render json: @survey_choice.errors, status: :unprocessable_entity }
end
end
end
# PUT /survey/choices/1
# PUT /survey/choices/1.json
def update
@survey_choice = Survey::Choice.find(params[:id])
respond_to do |format|
if @survey_choice.update_attributes(params[:survey_choice])
format.html { redirect_to @survey_choice, notice: 'Choice was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @survey_choice.errors, status: :unprocessable_entity }
end
end
end
# DELETE /survey/choices/1
# DELETE /survey/choices/1.json
def destroy
@survey_choice = Survey::Choice.find(params[:id])
@survey_choice.destroy
respond_to do |format|
format.html { redirect_to survey_choices_url }
format.json { head :no_content }
end
end
end

View File

@@ -0,0 +1,85 @@
class Survey::QuestionsController < ApplicationController
# GET /survey/questions
# GET /survey/questions.json
def index
@survey_questions = Survey::Question.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @survey_questions }
end
end
def answer
render :show
end
# GET /survey/questions/1
# GET /survey/questions/1.json
def show
@survey_question = Survey::Question.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @survey_question }
end
end
# GET /survey/questions/new
# GET /survey/questions/new.json
def new
@survey_question = Survey::Question.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @survey_question }
end
end
# GET /survey/questions/1/edit
def edit
@survey_question = Survey::Question.find(params[:id])
end
# POST /survey/questions
# POST /survey/questions.json
def create
@survey_question = Survey::Question.new(params[:survey_question])
respond_to do |format|
if @survey_question.save
format.html { redirect_to @survey_question, notice: 'Question was successfully created.' }
format.json { render json: @survey_question, status: :created, location: @survey_question }
else
format.html { render action: "new" }
format.json { render json: @survey_question.errors, status: :unprocessable_entity }
end
end
end
# PUT /survey/questions/1
# PUT /survey/questions/1.json
def update
@survey_question = Survey::Question.find(params[:id])
respond_to do |format|
if @survey_question.update_attributes(params[:survey_question])
format.html { redirect_to @survey_question, notice: 'Question was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @survey_question.errors, status: :unprocessable_entity }
end
end
end
# DELETE /survey/questions/1
# DELETE /survey/questions/1.json
def destroy
@survey_question = Survey::Question.find(params[:id])
@survey_question.destroy
respond_to do |format|
format.html { redirect_to survey_questions_url }
format.json { head :no_content }
end
end
end