reactjs/react-rails — pull request #95 by xionon (2014-10-04 20:24:51+00:00)
Title: Allow react_component to accept JSON strings

Rails ships with a useful JSON builder that makes rendering to strings of JSON via templates very easy, but rendering from plain objects to JSON not quite so easy. It's used by a lot of Rails apps as the default way to serialize objects to JSON.

This PR allows `react_component` to take a string as the props argument, and instead of calling `#to_json` on it, just pass it straight through to the renderer.

Basically, this allows syntax like the following:

```ruby
react_component(
'Todo',
render(template: 'todos/show.json.jbuilder', locals: {todo: @todo}),
{prerender: true}
)
```