Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

JSON is escaped oddly #85

Closed
jejacks0n opened this Issue · 3 comments

2 participants

@jejacks0n
Owner

I'm having troubles with mercury params (Rails 3.1.1rc1). I can read from console

{"content"=>"{\"article_title\":{\"type\":\"editable\",\"value\":\"hello-ise\",\"snippets\":{}},\"article_body\":{\"type\":\"editable\",\"value\":\"\n \tworld\n \n \t \",\"snippets\":{}}}", "locale"=>"fr", "id"=>"1"}

Somehow, under rails 3,1, mercury seems to escape parameters. And params in controller is wrongly interpreted.

@chandresh

I am having the same issue with Rails 3.1.3

mercury-rails: git: 'https://github.com/jejacks0n/mercury.git', ref: 'a2b16bcdc9'

Here is part of params hash:

Processing by PagesController#mercury_update as JSON
Parameters: {"content"=>"{\"page_name\":{\"type\":\"editable\",\"value\":\"about\",\"snippets\":{}},\"page_content\":{\"type\":\"editable\",\"value\":\"{\\"page_name\\":{\\"type\\":\\"editable\\",\\"value\\":\\"about\\",\\"snippets\\":{}},\\"page_content

@chandresh

As mentioned by Jean & kokolegorille on Railscasts comments ; this is solved by the following change:

in app/layouts/mercury.html.erb
saveStyle: null, // 'form', or 'json' (default json)

Change null to 'form'

@jejacks0n
Owner

I just fixed several aspects of this.. they should now behave the same -- and escaping has been fixed.

@jejacks0n jejacks0n closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.