Open ExReanimator opened 11 years ago
def create @status = 0 @errors = Array.new if @user.save @status = 1 else @user.errors.full_messages.each { |e| @errors << e } end end
object false node(:status) {|m| @status } if @errors.any? child @errors => :errors do extends "error" end end
partial "_error":
object @errors node(:text) { |e| e }
=> "{\"status\":0,\"errors\":[{\"error\":{\"text\":\"\xD0\x9F\xD0\xB0\xD1\x80\xD0\xBE\xD0\xBB\xD1\x8C \xD0\xBD\xD0\xB5 \xD0\xBC\xD0\xBE\xD0\xB6\xD0\xB5\xD1\x82 \xD0\xB1\xD1\x8B\xD1\x82\xD1\x8C \xD0\xBF\xD1\x83\xD1\x81\xD1\x82\xD1\x8B\xD0\xBC\"}},{\"error\":{\"text\":\"\xD0\x9F\xD0\xBE\xD0\xB4\xD1\x82\xD0\xB2\xD0\xB5\xD1\x80\xD0\xB6\xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB8\xD0\xB5 \xD0\xBF\xD0\xB0\xD1\x80\xD0\xBE\xD0\xBB\xD1\x8F \xD0\xBD\xD0\xB5 \xD0\xBC\xD0\xBE\xD0\xB6\xD0\xB5\xD1\x82 \xD0\xB1\xD1\x8B\xD1\x82\xD1\x8C \xD0\xBF\xD1\x83\xD1\x81\xD1\x82\xD1\x8B\xD0\xBC\"}}]}"
The problem is that in another rabl templates of my project strings was not decoded to utf symbols. How to disable that?
+1 I have this problem too.
Controller:
View (create.json.rabl):
partial "_error":
Result
=> "{\"status\":0,\"errors\":[{\"error\":{\"text\":\"\xD0\x9F\xD0\xB0\xD1\x80\xD0\xBE\xD0\xBB\xD1\x8C \xD0\xBD\xD0\xB5 \xD0\xBC\xD0\xBE\xD0\xB6\xD0\xB5\xD1\x82 \xD0\xB1\xD1\x8B\xD1\x82\xD1\x8C \xD0\xBF\xD1\x83\xD1\x81\xD1\x82\xD1\x8B\xD0\xBC\"}},{\"error\":{\"text\":\"\xD0\x9F\xD0\xBE\xD0\xB4\xD1\x82\xD0\xB2\xD0\xB5\xD1\x80\xD0\xB6\xD0\xB4\xD0\xB5\xD0\xBD\xD0\xB8\xD0\xB5 \xD0\xBF\xD0\xB0\xD1\x80\xD0\xBE\xD0\xBB\xD1\x8F \xD0\xBD\xD0\xB5 \xD0\xBC\xD0\xBE\xD0\xB6\xD0\xB5\xD1\x82 \xD0\xB1\xD1\x8B\xD1\x82\xD1\x8C \xD0\xBF\xD1\x83\xD1\x81\xD1\x82\xD1\x8B\xD0\xBC\"}}]}"
The problem is that in another rabl templates of my project strings was not decoded to utf symbols. How to disable that?