Class: Quadro::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/quadro/pages_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #after_sign_out_path_for

Instance Method Details

#createObject



11
12
13
14
# File 'app/controllers/quadro/pages_controller.rb', line 11

def create
  page.author = current_user
  page.save
end

#destroyObject



20
21
22
# File 'app/controllers/quadro/pages_controller.rb', line 20

def destroy
  page.destroy unless page.is_root?
end

#formObject



24
25
26
27
28
# File 'app/controllers/quadro/pages_controller.rb', line 24

def form
  interaction.ip_address = request.remote_ip
  interaction.user_agent = request.user_agent
  interaction.update_attributes(content: params[:form])
end

#updateObject



16
17
18
# File 'app/controllers/quadro/pages_controller.rb', line 16

def update
  page.update_attributes(params[:page])
end