Class: Fdbq::FeedbackController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/fdbq/feedback_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/fdbq/feedback_controller.rb', line 7

def create
  @feedback = Fdbq::Feedback.new(fields: permitted_params.to_h)
  
  if @feedback.save
    flash.now[:notice] = I18n.t('fdbq.events.created')
  end

  respond_to do |format|
    format.json { head(@feedback.persisted? ? 201 : 422) }
  end
end