diff --git a/app/controllers/aspect_memberships_controller.rb b/app/controllers/aspect_memberships_controller.rb index 77df0fe152c194b996e53c6883710163ac8dfe44..2bfd0c933cf71816d558476120246a4e4b5ff9cf 100644 --- a/app/controllers/aspect_memberships_controller.rb +++ b/app/controllers/aspect_memberships_controller.rb @@ -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 diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 214f484bb5b3bc96001f56148ffec2fdb2d26bbf..f9d4ad47d95176ceab20b3de8f1f859c38dee7ab 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -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 diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index 16451283997e1ffef9e69f43e7127bc2fb658a69..3f197765570b389a64918ebd1e80d32cbf2c4ef0 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -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 diff --git a/app/controllers/likes_controller.rb b/app/controllers/likes_controller.rb index de508f35146f72231043224a9539bddf314002ea..1827609512977e0022a0345b60e0d9cfd1f8699f 100644 --- a/app/controllers/likes_controller.rb +++ b/app/controllers/likes_controller.rb @@ -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 diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 1629fb7656a318cc6ab8a298c5662498793443ef..8b5386d2bfde57d0ceee6339aea789dede6ef380 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -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 diff --git a/app/controllers/reshares_controller.rb b/app/controllers/reshares_controller.rb index 4add931747ac1961c90227c8d86862674e64d34e..846091398bccc51c38990553c196179fb77c131d 100644 --- a/app/controllers/reshares_controller.rb +++ b/app/controllers/reshares_controller.rb @@ -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 diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5127cea84c73cdd19210146f609c606219fa7260..58ae46536ea25b4f82ccc3a4005d017809699f1b 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -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