Class: FeaturedPostsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

post /featured_posts



5
6
7
8
9
10
11
12
13
# File 'app/controllers/featured_posts_controller.rb', line 5

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

#destroyObject

delete /featured_posts/:id



16
17
18
19
20
# File 'app/controllers/featured_posts_controller.rb', line 16

def destroy
  @entity.destroy

  head :no_content
end