Class: Plug::Api::SiteNoticesController

Inherits:
ApiController
  • Object
show all
Defined in:
app/controllers/plug/api/site_notices_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

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

#showObject

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