Module: ResourcesController::RestActions

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
app/concerns/resources_controller/rest_actions.rb

Instance Method Summary collapse

Instance Method Details

#createObject



42
43
44
45
# File 'app/concerns/resources_controller/rest_actions.rb', line 42

def create
  @resource.save
  respond_with(respond_with_namespace, @resource)
end

#destroyObject



37
38
39
40
# File 'app/concerns/resources_controller/rest_actions.rb', line 37

def destroy
  @resource.destroy
  respond_with(respond_with_namespace, @resource)
end

#editObject



26
# File 'app/concerns/resources_controller/rest_actions.rb', line 26

def edit; end

#indexObject



23
# File 'app/concerns/resources_controller/rest_actions.rb', line 23

def index; end

#newObject



24
# File 'app/concerns/resources_controller/rest_actions.rb', line 24

def new; end

#showObject



25
# File 'app/concerns/resources_controller/rest_actions.rb', line 25

def show; end

#updateObject



28
29
30
31
32
33
34
35
# File 'app/concerns/resources_controller/rest_actions.rb', line 28

def update
  if Rails::VERSION::MAJOR < 4
    @resource.update_attributes(permitted_params)
  else
    @resource.update(permitted_params)
  end
  respond_with(respond_with_namespace, @resource)
end