add survey

This commit is contained in:
Yan
2017-11-06 18:51:15 +06:30
parent 396baee19c
commit 6917ce2612
11 changed files with 275 additions and 0 deletions

View File

@@ -1,2 +1,18 @@
class Origami::SurveysController < ApplicationController
def new
@survey = Account.new
end
def create
@survey = Account.new(survey_params)
respond_to do |format|
if @survey.save
format.html { redirect_to settings_accounts_url, notice: 'survey was successfully created.' }
format.json { render :index, status: :created, location: @survey }
else
format.html { render :new }
format.json { render json: settings_accounts_url.errors, status: :unprocessable_entity }
end
end
end
end