Skip to content

Instantly share code, notes, and snippets.

@darrenboyd
Created October 7, 2008 22:25
Show Gist options
  • Save darrenboyd/15403 to your computer and use it in GitHub Desktop.
Save darrenboyd/15403 to your computer and use it in GitHub Desktop.
Adding the asset information to the Channel
def to_xml(options={})
options[:procs] ||= []
options[:procs] << Proc.new() do |options|
options[:builder].tag!('big-image-url', "http://#{EMAIL_DOMAIN_NAME}#{big_image.uri_path}")
end
super
end
<<EOF
That code produces...
development> puts Channel.find(93).to_xml
<?xml version="1.0" encoding="UTF-8"?>
<channel>
<category-id type="integer">22</category-id>
<channel-type>subscription</channel-type>
<content-provider-id type="integer">10</content-provider-id>
<created-at type="datetime">2008-01-30T10:43:47-08:00</created-at>
<description></description>
<id type="integer">93</id>
<intro-snack-id type="integer" nil="true"></intro-snack-id>
<long-text>Get tasty clips of beautiful ladies from all over the world sent to your phone once a day. Delicious!</long-text>
<name>Hot Girls</name>
<priority type="integer">0</priority>
<slug>hot-girls</slug>
<sponsor-link></sponsor-link>
<updated-at type="datetime">2008-08-01T08:51:58-07:00</updated-at>
<big-image-url>http://localhost:3000/st/channels/93/big_image.jpg</big-image-url>
</channel>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment