Replace render text: ... with render plain: ...
This commit is contained in:
parent
4bbc51bfb9
commit
d5f24021a7
7 changed files with 14 additions and 14 deletions
|
|
@ -30,7 +30,7 @@ class AspectMembershipsController < ApplicationController
|
|||
if success
|
||||
render json: AspectMembershipPresenter.new(membership).base_hash
|
||||
else
|
||||
render text: membership.errors.full_messages, status: 403
|
||||
render plain: membership.errors.full_messages, status: 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -53,21 +53,21 @@ class AspectMembershipsController < ApplicationController
|
|||
else
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render text: I18n.t("aspects.add_to_aspect.failure"), status: 409
|
||||
render plain: I18n.t("aspects.add_to_aspect.failure"), status: 409
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
rescue_from ActiveRecord::StatementInvalid do
|
||||
render text: I18n.t("aspect_memberships.destroy.invalid_statement"), status: 400
|
||||
render plain: I18n.t("aspect_memberships.destroy.invalid_statement"), status: 400
|
||||
end
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound do
|
||||
render text: I18n.t("aspect_memberships.destroy.no_membership"), status: 404
|
||||
render plain: I18n.t("aspect_memberships.destroy.no_membership"), status: 404
|
||||
end
|
||||
|
||||
rescue_from Diaspora::NotMine do
|
||||
render text: I18n.t("aspect_memberships.destroy.forbidden"), status: 403
|
||||
render plain: I18n.t("aspect_memberships.destroy.forbidden"), status: 403
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ class CommentsController < ApplicationController
|
|||
begin
|
||||
comment = comment_service.create(params[:post_id], params[:text])
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render text: I18n.t("comments.create.error"), status: 404
|
||||
render plain: I18n.t("comments.create.error"), status: 404
|
||||
return
|
||||
end
|
||||
|
||||
if comment
|
||||
respond_create_success(comment)
|
||||
else
|
||||
render text: I18n.t("comments.create.error"), status: 422
|
||||
render plain: I18n.t("comments.create.error"), status: 422
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ConversationsController < ApplicationController
|
|||
end
|
||||
|
||||
unless person_ids.present?
|
||||
render text: I18n.t("javascripts.conversation.create.no_recipient"), status: 422
|
||||
render plain: I18n.t("javascripts.conversation.create.no_recipient"), status: 422
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ class ConversationsController < ApplicationController
|
|||
flash[:notice] = I18n.t("conversations.create.sent")
|
||||
render json: {id: @conversation.id}
|
||||
else
|
||||
render text: I18n.t("conversations.create.fail"), status: 422
|
||||
render plain: I18n.t("conversations.create.fail"), status: 422
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class LikesController < ApplicationController
|
|||
def create
|
||||
like = like_service.create(params[:post_id])
|
||||
rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid
|
||||
render text: I18n.t("likes.create.error"), status: 422
|
||||
render plain: I18n.t("likes.create.error"), status: 422
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html { head :created }
|
||||
|
|
@ -26,7 +26,7 @@ class LikesController < ApplicationController
|
|||
if like_service.destroy(params[:id])
|
||||
head :no_content
|
||||
else
|
||||
render text: I18n.t("likes.destroy.error"), status: 404
|
||||
render plain: I18n.t("likes.destroy.error"), status: 404
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class PostsController < ApplicationController
|
|||
end
|
||||
|
||||
rescue_from Diaspora::NotMine do
|
||||
render text: I18n.t("posts.show.forbidden"), status: 403
|
||||
render plain: I18n.t("posts.show.forbidden"), status: 403
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class ResharesController < ApplicationController
|
|||
def create
|
||||
reshare = reshare_service.create(params[:root_guid])
|
||||
rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid
|
||||
render text: I18n.t("reshares.create.error"), status: 422
|
||||
render plain: I18n.t("reshares.create.error"), status: 422
|
||||
else
|
||||
render json: ExtremePostPresenter.new(reshare, current_user), status: 201
|
||||
end
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class StatusMessagesController < ApplicationController
|
|||
logger.debug error
|
||||
respond_to do |format|
|
||||
format.mobile { redirect_to stream_path }
|
||||
format.json { render text: error.message, status: 403 }
|
||||
format.json { render plain: error.message, status: 403 }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue