Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/api/v1/annotations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
if @annotation.save
render json: @annotation, status: :ok
else
render json: {}, status: :unprocessable_entity
render json: {}, status: :unprocessable_content
end
end

Expand All @@ -22,7 +22,7 @@ def update
if @annotation.update(annotation: params[:annotation])
render json: @annotation, status: :ok
else
render json: {}, status: :unprocessable_entity
render json: {}, status: :unprocessable_content
end
end

Expand All @@ -32,7 +32,7 @@ def destroy
@annotation.destroy
render json: @annotation, status: :ok
else
render json: {}, status: :unprocessable_entity
render json: {}, status: :unprocessable_content
end
end
end
8 changes: 4 additions & 4 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def create
format.html { redirect_to events_path, notice: "Event was successfully created." }
format.json { render :show, status: :created, location: @event }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @event.errors, status: :unprocessable_entity }
format.html { render :new, status: :unprocessable_content }
format.json { render json: @event.errors, status: :unprocessable_content }
end
end
end
Expand All @@ -41,8 +41,8 @@ def update
format.html { redirect_to events_path, notice: "Event was successfully updated." }
format.json { render :show, status: :ok, location: @event }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @event.errors, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @event.errors, status: :unprocessable_content }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/facilitators_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def create
if @facilitator.save
format.html { redirect_to @facilitator, notice: "Facilitator was successfully created." }
else
format.html { render :new, status: :unprocessable_entity }
format.html { render :new, status: :unprocessable_content }
end
end
end
Expand All @@ -40,7 +40,7 @@ def update
if @facilitator.update(facilitator_params)
format.html { redirect_to @facilitator, notice: "Facilitator was successfully updated." }
else
format.html { render :edit, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/faqs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create
redirect_to faqs_path, notice: "FAQ was successfully created."
else
set_form_variables
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -37,7 +37,7 @@ def update
redirect_to faqs_path, notice: "FAQ was successfully updated.", status: :see_other
else
set_form_variables
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def create
redirect_to users_path, notice: "User was successfully created."
else
set_form_variables
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -54,7 +54,7 @@ def update
else
flash[:alert] = 'Unable to update user.'
set_form_variables
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/workshop_logs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create
redirect_to authenticated_root_path
else
set_form_variables
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/templates/rails/scaffold_controller/controller.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class <%= controller_class_name %>Controller < ApplicationController
redirect_to <%= index_helper %>_path, notice: "<%= human_name %> was successfully created."
else
set_form_variables
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -35,7 +35,7 @@ class <%= controller_class_name %>Controller < ApplicationController
redirect_to <%= index_helper %>_path, notice: "<%= human_name %> was successfully updated.", status: :see_other
else
set_form_variables
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/requests/events_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
it "renders a response with validation errors (i.e. to display the 'new' template)" do
sign_in user
post events_url, params: { event: invalid_attributes }
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end
end
end
Expand Down
Loading