Class: Plug::Api::FeaturesController

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

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /features.json



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

def index
  @features = Feature.all

  render json: @features
end

#showObject

GET /features/slug.json



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

def show
  @feature = Feature.slug_and_name(params[:slug]).first

  render json: @feature
end