Displaying 1 result from an estimated 1 matches for "date_query".
Did you mean:
update_query
2009 Sep 19
0
Merging API data and ActiveRecord data for display in the view...
...hich is is common in both
the ActiveRecord results and the JSON results from the API. Created_at
is the only common element between the two data sets.
Here’s what I have in my controller for retrieving the data:
@diary = current_user.diary(params[:page])
start_date = @diary.first.created_at.to_s(:date_query)
end_date = @diary.last.created_at.to_s(:date_query)
@tweets = JSON.parse(Net::HTTP.get(URI.parse("http://
search.twitter.com/search.json?from=#{current_user.twitter_name}
&since=#{start_date}&until=#{end_date}")))
@tweets = @tweets[''results'']
@blend = @diary.ent...