Module: Intermodal::Controllers::ResourceLinking

Extended by:
ActiveSupport::Concern
Included in:
LinkingResourceController
Defined in:
lib/intermodal/concerns/controllers/resource_linking.rb

Instance Method Summary collapse

Instance Method Details

#createObject



42
43
44
45
# File 'lib/intermodal/concerns/controllers/resource_linking.rb', line 42

def create
  return head :status => 422 unless target_ids
  respond_with model.replace(params[:id], target_ids, :account => ), :location => nil
end

#destroyObject



52
53
54
55
# File 'lib/intermodal/concerns/controllers/resource_linking.rb', line 52

def destroy
  return head :status => 422 unless target_ids
  respond_with(model.remove(params[:id], target_ids, :account => ))
end

#indexObject



38
39
40
# File 'lib/intermodal/concerns/controllers/resource_linking.rb', line 38

def index
  respond_with presented_collection
end

#updateObject



47
48
49
50
# File 'lib/intermodal/concerns/controllers/resource_linking.rb', line 47

def update
  return head :status => 422 unless target_ids
  respond_with(model.append(params[:id], target_ids, :account => ))
end