Class: SystemTester::FeaturesController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- SystemTester::FeaturesController
- Defined in:
- app/controllers/system_tester/features_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/controllers/system_tester/features_controller.rb', line 9 def create feature = Feature.new(feature_params) if feature.save render json: feature.to_json() else render json: { errors: feature.errors }, status: :unprocessable_entity end end |
#destroy ⇒ Object
27 28 29 30 |
# File 'app/controllers/system_tester/features_controller.rb', line 27 def destroy Feature.find(params[:id]).destroy! render json: {} end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/system_tester/features_controller.rb', line 5 def index render json: Feature.all.to_json() end |
#update ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/controllers/system_tester/features_controller.rb', line 18 def update feature = Feature.find(params[:id]) if feature.update(feature_params) render json: feature.to_json() else render json: { errors: feature.errors }, status: :unprocessable_entity end end |