Module: RocketCMS::Controllers::Contacts

Extended by:
ActiveSupport::Concern
Included in:
ContactsController
Defined in:
lib/rocket_cms/controllers/contacts.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rocket_cms/controllers/contacts.rb', line 10

def create
  @contact_message = model.new(message_params)
  after_initialize
  if RocketCMS.config.contacts_captcha
    meth = :save_with_captcha
  else
    meth = :save
  end
  if @contact_message.send(meth)
    after_create
    if request.xhr? && process_ajax
      ajax_success
    else
      redirect_after_done
    end
  else
    render_contacts_error
  end
end

#newObject



5
6
7
8
# File 'lib/rocket_cms/controllers/contacts.rb', line 5

def new
  @contact_message = model.new
  after_initialize
end

#sentObject



30
31
# File 'lib/rocket_cms/controllers/contacts.rb', line 30

def sent
end