I am trying to execute two helper functions of in a view call the second with the return of the first. I know the following functions properly returns the desired hash:
%p = helper_method0 params[:some_string] #does a request on a third party site which responds with json data wich is then parsed by yajl and the hash is returned to view
However when I call the following:
- hash = helper_method0 params[:some_string] #does a request on a third party site which responds with json data wich is then parsed by yajl and the hash is returned to view
%p= helper_method1 hash #Literally is just returning the input parameter
I receive the following error message
Found multiple JSON objects in the stream but no block or the on_parse_complete callback was assigned to handle them.
How do I call a method with an input parameter as the return of another method from the view?
What you are doing is perfectly correct 🙂
And you could also do:
(if you want to save bytes and variables)
But anyway…
This error sounds like a problem in the json parser… are you using Yajl?
I have seen this issue when using Yajl like this:
What worked for me was to use the Yajl class method like this:
I hope this helps 🙂