I have a script that I have written in ruby to parse all the titles
in external JSON feed. Now I have to show them as data-source
for the typeahead utility of twitter bootstrap.
require 'open-uri'
require 'json'
result = JSON.parse(open("http://data.example.com/locations.json").read)
result.each do |bldg|
puts bldg['title']
end
So I want to use the above snippet in the rails app.
How to apply some custom ruby inside a Rails app?
Thanks!