19 lines
526 B
Ruby
19 lines
526 B
Ruby
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
|