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



7
8
9
10
11
# File 'app/controllers/plug/api/site_notices_controller.rb', line 7

def index
  @site_notices = SiteNotice.all

  render json: @site_notices
end

#showObject

GET /site_notices/slug.json



14
15
16
17
18
# File 'app/controllers/plug/api/site_notices_controller.rb', line 14

def show
  @site_notice = SiteNotice.slug_and_name(params[:slug]).first

  render json: @site_notice
end