Class: Feedy::FeedbacksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/feedy/feedbacks_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user

Instance Method Details

#createObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/feedy/feedbacks_controller.rb', line 14

def create
  if Feedy.anonymous_feedback
    @feedback = Feedback.new(feedback_params)
  else
    @feedback = send(Feedy.current_user_helper).feedbacks.new(feedback_params)
  end

  if @feedback.save
    respond_to do |format|
      format.js { head :created }
    end
  end
end

#destroyObject



28
29
30
31
32
# File 'app/controllers/feedy/feedbacks_controller.rb', line 28

def destroy
  if @feedback.destroy
    head 204
  end
end

#indexObject



8
9
# File 'app/controllers/feedy/feedbacks_controller.rb', line 8

def index
end

#showObject



11
12
# File 'app/controllers/feedy/feedbacks_controller.rb', line 11

def show
end