Module: Middleman::Features::RemoteData::ClassMethods
- Defined in:
- lib/middleman-remote-data.rb
Instance Method Summary collapse
-
#data_source(name, url) ⇒ Object
Makes HTTP json data available in the data object.
Instance Method Details
#data_source(name, url) ⇒ Object
Makes HTTP json data available in the data object
data_source :my_json, "http://my/file.json"
Available in templates as:
data.my_json
19 20 21 22 23 |
# File 'lib/middleman-remote-data.rb', line 19 def data_source(name, url) data_callback(name) do HTTParty.get(url).parsed_response end end |