Class: Hicube::ContentsController

Inherits:
BaseController show all
Defined in:
app/controllers/hicube/contents_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::FLASH_TYPES

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #notify, #notify_now

Instance Method Details

#updateObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/controllers/hicube/contents_controller.rb', line 22

def update
  logger.debug "Updating Pages with #{params}"
  @content.update_attributes content_params

  @content.save!
  respond_to do |format|
    format.json { render json: true }
  end
rescue Mongoid::Errors::Validations => e
  respond_to do |format|
    format.json { render json: false }
  end 
end