Sha256: cddcc3c5da5f2bc0d8b2cb862c5cfb3b9fcb0b9e513b444b81b14f35936ebb61

Contents?: true

Size: 564 Bytes

Versions: 1

Compression:

Stored size: 564 Bytes

Contents

class FormAnswersController < ApplicationController

  respond_to :html, :json

  def create
    params[:form_answer] ||= {}
    if answer = ActiveadminSelleoCms::FormAnswer.where(form_uuid: params[:form_answer][:form_uuid], dom_id: params[:form_answer][:dom_id]).first
      answer.update_attribute(:value, params[:form_answer][:value])
    else
      ActiveadminSelleoCms::FormAnswer.create(params[:form_answer])
    end
    render nothing: true
  end

  def index
    respond_with ActiveadminSelleoCms::FormAnswer.where(form_uuid: params[:form_uuid])
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-selleo-cms-0.0.46 app/controllers/form_answers_controller.rb