POST/PATCH html, css & js as JSON values in rails?

I’m gonna summarise the question here, but the code and detailed
situation
is best described at StackOverFlow:

http://stackoverflow.com/questions/34960077/post-patch-html-css-js-as-json-values-in-rails

I’m POSTing/PATCHing a JSON to a rails API endpoint with key-value pairs
of
HTML, CSS, JS and HEAD.

The values contain raw html, raw css, raw js with special characters
like
%, @, &, ; that rails probably doesn’t like. The parser is currently
removing these special characters and it kind of screws up the data
(whole
html, whole css and also user generated javascript) by removing % & from
in
between.

Is there a way to let in incoming JSON as is, through the rails’ JSON
parser?

On Sat, Jan 23, 2016 at 12:30 AM, Marvin D. [email protected]
wrote:

I’m gonna summarise the question here, but the code and detailed situation
is best described at StackOverFlow:

Not sure why you’d say that, but in any case…

I’m POSTing/PATCHing a JSON to a rails API endpoint with key-value pairs of
HTML, CSS, JS and HEAD.

The values contain raw html, raw css, raw js with special characters like %,
@, &, ; that rails probably doesn’t like. The parser is currently removing
these special characters

Can you show a (minimal) example of the actual JSON being sent?

Have you written a test that demonstrates the failure?


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs