Class: FeaturedPostsController
- Inherits:
-
AdminController
- Object
- AdminController
- FeaturedPostsController
- Defined in:
- app/controllers/featured_posts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
post /featured_posts.
-
#destroy ⇒ Object
delete /featured_posts/:id.
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |