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
# File 'app/controllers/featured_posts_controller.rb', line 5

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

#destroyObject

delete /featured_posts/:id



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

def destroy
  @entity.destroy

  head :no_content
end