Class: Plug::Api::SiteNoticesController
- Inherits:
-
ApiController
- Object
- ActionController::Base
- ApiController
- Plug::Api::SiteNoticesController
- Defined in:
- app/controllers/plug/api/site_notices_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET /site_notices.json.
-
#show ⇒ Object
GET /site_notices/slug.json.
Instance Method Details
#index ⇒ Object
GET /site_notices.json
9 10 11 12 13 |
# File 'app/controllers/plug/api/site_notices_controller.rb', line 9 def index @site_notices = SiteNotice.all render json: @site_notices end |
#show ⇒ Object
GET /site_notices/slug.json
16 17 18 19 20 |
# File 'app/controllers/plug/api/site_notices_controller.rb', line 16 def show @site_notice = SiteNotice.slug_and_name(params[:slug]).first render json: @site_notice end |