Class: Ecm::Comments::Backend::CommentsController

Inherits:
Itsf::Backend::Resource::BaseController
  • Object
show all
Defined in:
app/controllers/ecm/comments/backend/comments_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.resource_classObject



5
6
7
# File 'app/controllers/ecm/comments/backend/comments_controller.rb', line 5

def self.resource_class
  Ecm::Comments::Comment
end

Instance Method Details

#createObject



9
10
11
12
13
14
15
# File 'app/controllers/ecm/comments/backend/comments_controller.rb', line 9

def create
  @resource = initialize_scope.new(permitted_params)
  @resource.creator = current_user
  @resource.created_by_ip_address = request.remote_ip
  @resource.save
  respond_with @resource, location: after_create_location
end

#updateObject



17
18
19
20
21
22
23
# File 'app/controllers/ecm/comments/backend/comments_controller.rb', line 17

def update
  @resource = load_resource
  @resource.updater = current_user
  @resource.updated_by_ip_address = request.remote_ip
  @resource.update(permitted_params)
  respond_with @resource, location: after_update_location
end