Class: PostLinksController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/post_links_controller.rb

Overview

Managing post links

Instance Method Summary collapse

Instance Method Details

#createObject

post /post_links



8
9
10
11
12
13
14
15
# File 'app/controllers/post_links_controller.rb', line 8

def create
  @entity = PostLink.new(entity_parameters)
  if @entity.save
    render status: :created
  else
    render json: { errors: @entity.errors }, status: :bad_request
  end
end

#destroyObject

delete /post_links/:id



18
19
20
21
22
# File 'app/controllers/post_links_controller.rb', line 18

def destroy
  @entity.destroy

  head :no_content
end