Class: Incline::ContactController

Inherits:
ApplicationController show all
Defined in:
app/controllers/incline/contact_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /incline/contact



14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/incline/contact_controller.rb', line 14

def create
  @msg = get_message
  if @msg.valid?
    @msg.remote_ip = request.remote_ip
    @msg.send_message
    flash[:success] = 'Your message has been sent.'
    redirect_to main_app.root_url
  else
    render 'new'
  end
end

#newObject

GET /incline/contact



8
9
10
# File 'app/controllers/incline/contact_controller.rb', line 8

def new
  @msg = Incline::ContactMessage.new
end