Use, but the test to code ratio is slim atm. The specs directory has some examples of programmatic See the rdocs for much more complete examples. See the RDocs for OEmbed::TemplateResolver for more information regarding templates and oembed_links. Pipeline, and as such may even do evil things like access your Models. (such as Rails' link_to, image_tag, etc.) the templates are processed using the Rails template rendering The absolute filename method, you only have access to ERB, Erubis or HAML.Īs of version 0.0.9, your Rails oembed templates have access to all the traditional Rails template helper methods With Rails, you may use any template library that is installed for your Rails app when you are using Template functionality, but you must specify the full path to the template. If you are not using Rails, you may still use the This presumes you have a directory in your Rails views directory called "oembed", and a file Res.any?(:template => "shared/oembed_link") Res.matches?(/some_regex/, :template => "shared/oembed_link") Res.from?(:a_provider, :template => "a_provider/oembed") Templates, you can do so using the following syntax: If you'd like to transform the oembedded content via It will fall back to hpricot if that is installed, and finally REXMLĬopy the included oembed_links_example.yml file to RAILS_ROOT/config/oembed_links.yml,Īdd a dependency to the gem in your environment.rb ( config.gem "oembed_links" )Īnd start your server. If you have the libxml-ruby gem installed, oembed_links will use that You must have the JSON gem installed to use oembed_links. May also configure the library programmatically (see rdocs). Library has been included (oembed_links_example.yml), though you A sample configuration file for configuring the Query configured providers for embedding information on the links
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |