diff options
Diffstat (limited to 'app/controllers/projects/environments_controller.rb')
-rw-r--r-- | app/controllers/projects/environments_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index 8519841ee16..cac0aa9d513 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -87,17 +87,17 @@ class Projects::EnvironmentsController < Projects::ApplicationController @environment = project.environments.create(environment_params) if @environment.persisted? - redirect_to project_environment_path(project, @environment) + render json: { environment: @environment, path: project_environment_path(project, @environment) } else - render :new + render json: { message: @environment.errors.full_messages }, status: :bad_request end end def update if @environment.update(environment_params) - redirect_to project_environment_path(project, @environment) + render json: { environment: @environment, path: project_environment_path(project, @environment) } else - render :edit + render json: { message: @environment.errors.full_messages }, status: :bad_request end end |