Class: MessagesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/messages_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Convenient method to create and check for spam



4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/messages_controller.rb', line 4

def create
  @message = Georgia::Message.new(message_params)
  if @message.valid? and @message.save
    SpamWorker.perform_async(@message.id)
  end
  respond_to do |format|
    # FIXME: Add translated flash message on success and failure
    format.html { redirect_to :back }
    format.js   { render layout: false }
  end
end