I have a rails app that uses a twitter library to pull in tweets and display them one by one in my view using jquery. I am a little unsure of what the best way to transporting the tweets over from the controller to the view is though. The two ideas I have are:
-
Get back the twitter json in the controller/model, pass it to the view using jquery and then constructing the html with dom building methods.
-
Get back the twitter json in the controller/model, render a partial that displays a list of tweets with html and passing over that html partial with jquery.
Is one of these methods better than the other? Is there a completely better way of doing this?
Any help would be great!
partials would make the result indexable if you wanted to build html on the page directly.
the javascript + json idea should be easier to implement but not by much.