Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anthonybishopric/schema.org
Apply schema.org microdata to your erb files
https://github.com/anthonybishopric/schema.org
Last synced: 3 months ago
JSON representation
Apply schema.org microdata to your erb files
- Host: GitHub
- URL: https://github.com/anthonybishopric/schema.org
- Owner: anthonybishopric
- License: mit
- Created: 2011-06-04T02:34:42.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-06-05T23:56:43.000Z (over 13 years ago)
- Last Synced: 2024-02-12T17:07:46.784Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 95.7 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE
Awesome Lists containing this project
README
:::INSTALLATION:::
--
cd vendor/plugins
git clone git://github.com/anthonybishopric/schema.org.git schemaorg
--::USAGE::
# Let's say you have a Bird model
class Bird < ActiveRecord::Base
validates_presence_of :name, :birth
microdata_item :thing # the name of the schema
microdata_attributes :birth => :birthDate # explicit mapping of attribute if necessary
def birth # works with both ActiveModel::Attributes and regular methods
DateTime.now
end
end# here's an instance of it we make available in a controller
# @bird{
# name: 'Foo',
# birth: '2011-06-05'
# }---------------------
<%= micro @bird do |metabird|%>
Name:
<%= metabird.name %>
Born:
<%= metabird.birth.strftime("%B %d, %Y")%><%end%>
::TODO::
* Regression tests
* Convert to Gem
* Better association handling
* Schema validation