transloadit/rails-sdk — Issue #19: Options not working because to_json makes everything a string
Author: michikono
Created: 2012-01-26 02:03:37+00:00
State: open

In [Issue #3](https://github.com/transloadit/rails-sdk/issues/3) you state you can pass arguments correctly. However, if I want to add a callback function such as `:onResult => "my_function() { alert('do stuff') }"`, the resulting javascript ends up looking like:

```javascript
"onResult": "my_function() { alert('do stuff') }"
```

`onResult()` is a string (rather than a function) and thus, not actually executed. It seems this happens because you parse the options using to_json, which would convert any Javascript code into a string rather than pass it straight through. Am I missing something here? Is there a better way to do this using your gem?