Class: Friday::DependenciesController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Friday::DependenciesController
- Defined in:
- app/controllers/friday/dependencies_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET /dependencies.
-
#show ⇒ Object
GET /dependencies/:language/:name.
Instance Method Details
#index ⇒ Object
GET /dependencies
8 9 10 11 12 |
# File 'app/controllers/friday/dependencies_controller.rb', line 8 def index @dependencies = Dependency.all render json: @dependencies end |
#show ⇒ Object
GET /dependencies/:language/:name
15 16 17 18 19 20 21 |
# File 'app/controllers/friday/dependencies_controller.rb', line 15 def show return render json: {}, status: :bad_request if params[:language] != 'ruby' || params[:name].include?(':') @dependency = Dependency.new(params[:language], params[:name]) render json: @dependency.with_dependents end |