<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Go Tripod Ltd &#187; Ruby on Rails</title>
	<atom:link href="http://www.gotripod.com/tag/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gotripod.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 01 Mar 2010 22:23:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails deployment is so easy these days</title>
		<link>http://www.gotripod.com/2008/11/22/rails-deployment-is-so-easy-these-days/</link>
		<comments>http://www.gotripod.com/2008/11/22/rails-deployment-is-so-easy-these-days/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 12:04:16 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Phusion Passenger]]></category>

		<guid isPermaLink="false">http://clockobj.co.uk/?p=196</guid>
		<description><![CDATA[I have been meaning to blog about Phusion Passenger for a while as about 3-4 months ago we migrated Stubmatic from using Apache / Mongrel Cluster to Phusion Passenger A.K.A. mod_rails.

Mod rails is extreamly easy to install. Make sure you update gem first:

gem update --system

Then install the Phusion Passenger gem

gem install passenger

Once complete you can [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gotripod.com/wp-content/uploads/2008/11/enterprise_logo_alpha.png"><img class="float_left alignleft size-full wp-image-214" style="margin: 5px;" title="enterprise_logo_alpha" src="http://www.gotripod.com/wp-content/uploads/2008/11/enterprise_logo_alpha.png" alt="" width="261" height="68" /></a>I have been meaning to blog about Phusion Passenger for a while as about 3-4 months ago we migrated Stubmatic from using Apache / Mongrel Cluster to <a href="http://www.modrails.com/">Phusion Passenger A.K.A. mod_rails</a>.<br />
<span id="more-196"></span><br />
Mod rails is extreamly easy to install. Make sure you update gem first:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem update <span style="color: #660033;">--system</span></pre></div></div>

<p>Then install the Phusion Passenger gem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> passenger</pre></div></div>

<p>Once complete you can run the Phusion Passenger install that compiles mod_rails for you.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">passenger-install-apache2-module</pre></div></div>

<p>Once this completes it will give you some code to past into your httpd.conf file and you are ready to start configuring your sites.. Well actually if you have been using Mongrels then time to strip most of the configuration out of your https.conf file. You can have as simple a configuration as shown below. <strong>Note:</strong> The DocumentRoot should be set to the public folder within your app. Passenger automatically detects that this is a rails app.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    ServerName www.stubmatic.com
    DocumentRoot /websites/stubmatic/public</pre></div></div>

<p>One thing to note is that by default Passenger disables ModRewrite for that VirtualHost and in our case we use ModRewrite for a number of things such as providing a Maintenance page when maintenance.html is in our public folder allowing us to take the app offline. We also use ModRewrite to hide .svn folders, so we needed to use ModRewrite. Thankfully Passenger provides a solution. <strong>Note: You must first make sure you remove the .htaccess file in your rails public folder!</strong></p>
<p>So our new Apache configuration looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    ServerName www.stubmatic.com
    DocumentRoot /websites/stubmatic/public
&nbsp;
    RailsAllowModRewrite on
&nbsp;
    RewriteEngine On
&nbsp;
    RewriteRule ^(.*/)?.svn/ - [F,L]
&nbsp;
    RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.html
    RewriteRule ^.*$ /maintenance.html [L]</pre></div></div>

<p>If you want to setup an Apache / Phusion Passenger testing server you will also need to add the following directive to your VirtualHost configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">RailsEnv development</pre></div></div>

<p>As you can see Phusion Passenger make deployment of Ruby on Rails as trivial as deploying a PHP. You can easily reload Phusion Passenger by running the following command from within your Rails project root.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">touch tmp/restart.txt</pre></div></div>

<p>In terms of performance, Phusion Passenger holds it&#8217;s own against Mongrel and there are <a href="http://www.modrails.com/documentation.html">plenty of details on Phusion&#8217;s website</a>.</p>
<p>For more information:</p>
<ol>
<li><a href="http://www.modrails.com/">Phusion Passenger</a></li>
<li><a href="http://www.modrails.com/documentation/Users%20guide.html">Phusion Passenger Documentation</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2008/11/22/rails-deployment-is-so-easy-these-days/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails, PayPal Express Recurring Payments using Active Merchant</title>
		<link>http://www.gotripod.com/2008/09/08/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/</link>
		<comments>http://www.gotripod.com/2008/09/08/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 09:31:52 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[PayPal]]></category>

		<guid isPermaLink="false">http://clockobj.co.uk/?p=128</guid>
		<description><![CDATA[I recently needed to setup recurring payments through PayPal&#8217;s express checkout for a subscription based site I have writen using Ruby on Rails. There is already an excellent framework for interacting with most payment gateways, including PayPal, for Ruby called Active Merchant. Unfortunately recurring payments support in Active Merchant for PayPal Express Checkout is limited [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to setup recurring payments through PayPal&#8217;s express checkout for a subscription based site I have writen using Ruby on Rails. There is already an excellent framework for interacting with most payment gateways, including PayPal, for Ruby called <a href="http://www.activemerchant.org/">Active Merchant</a>. Unfortunately recurring payments support in Active Merchant for PayPal Express Checkout is limited to a <a href="http://jadedpixel.lighthouseapp.com/projects/11599-active-merchant/tickets/17-patch-creating-paypal-recurring-payments-profile-with-activemerchant#ticket-17-4">script pasted into their lighthous bug tracking system</a>. The trouble is that this script only covers creating subscription profiles and also later getting details of that profile, but I needed to be able to suspend and cancel subscriptions profiles as well as make changes to the subscription from my site.</p>
<p><span id="more-128"></span></p>
<p><strong>**** UPDATE: ActiveMerchant recently removed the functionality to use PayPal&#8217;s NVP API and so this code will no longer work with the latest ActiveMerchant. Raymond Law has kindly ported the code to use the SOAP API and <a href="http://rayvinly.com/articles/2009/02/20/paypal-recurring-billing-with-activemerchant-in-ruby-on-rails/">you can find out more information and usage on his blog</a>. ****</strong></p>
<p>Active Merchant is very easy to extend so I have written a Ruby class that can be dropped into /vendor/plugins/active_merchant/billing/gateways/ within your Rails project (assuming you have AM installed as a plugin)</p>
<p>Below is the code: (I have also attached the .rb file: <a href="http://www.gotripod.com/wp-content/uploads/2008/09/paypal_express_recurring_nv.rb">paypal_express_recurring_nv.rb</a>)</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># simple extension to ActiveMerchant for basic support of recurring payments with Express Checkout API</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;"># See http://http://www.gotripod.com/2008/09/07/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/</span>
<span style="color:#008000; font-style:italic;"># for details on getting started with this gateway</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#9966CC; font-weight:bold;">module</span> ActiveMerchant <span style="color:#008000; font-style:italic;">#:nodoc:</span>
  <span style="color:#9966CC; font-weight:bold;">module</span> Billing <span style="color:#008000; font-style:italic;">#:nodoc:</span>
    <span style="color:#9966CC; font-weight:bold;">class</span> PaypalExpressRecurringNvGateway <span style="color:#006600; font-weight:bold;">&amp;</span>lt; Gateway
      <span style="color:#9966CC; font-weight:bold;">include</span> PaypalNvCommonAPI
&nbsp;
      LIVE_REDIRECT_URL = <span style="color:#996600;">'https://www.paypal.com/cgibin/webscr?cmd=_customer-billing-agreement&amp;amp;token='</span>
      TEST_REDIRECT_URL = <span style="color:#996600;">'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_customer-billing-agreement&amp;amp;token='</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> redirect_url
        test? ? TEST_REDIRECT_URL : LIVE_REDIRECT_URL
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> redirect_url_for<span style="color:#006600; font-weight:bold;">&#40;</span>token<span style="color:#006600; font-weight:bold;">&#41;</span>
          <span style="color:#996600;">&quot;#{redirect_url}#{token}&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> setup_agreement<span style="color:#006600; font-weight:bold;">&#40;</span>description, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        requires!<span style="color:#006600; font-weight:bold;">&#40;</span>options, <span style="color:#ff3333; font-weight:bold;">:return_url</span>, <span style="color:#ff3333; font-weight:bold;">:cancel_return_url</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'SetCustomerBillingAgreement'</span>, build_setup_agreement<span style="color:#006600; font-weight:bold;">&#40;</span>description, options<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> get_agreement<span style="color:#006600; font-weight:bold;">&#40;</span>token<span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'GetBillingAgreementCustomerDetails'</span>, build_get_agreement<span style="color:#006600; font-weight:bold;">&#40;</span>token<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> create_profile<span style="color:#006600; font-weight:bold;">&#40;</span>money, token, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'CreateRecurringPaymentsProfile'</span>, build_create_profile<span style="color:#006600; font-weight:bold;">&#40;</span>money, token, options<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> get_profile_details<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'GetRecurringPaymentsProfileDetails'</span>, build_get_profile_details<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> manage_profile<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, action, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'ManageRecurringPaymentsProfileStatus'</span>, build_manage_profile<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, action, options<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> update_profile<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'UpdateRecurringPaymentsProfile'</span>, build_update_profile<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, options<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> bill_outstanding<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, money, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        commit <span style="color:#996600;">'BillOutstandingAmount'</span>, build_bill_outstanding<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, money, options<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      private
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_setup_agreement<span style="color:#006600; font-weight:bold;">&#40;</span>description, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:billingagreementdescription</span>, description<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:returnurl</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:return_url</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:cancelurl</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:cancel_return_url</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:billingtype</span>, <span style="color:#996600;">&quot;RecurringPayments&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:paymenttype</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:payment_type</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:payment_type</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:localecode</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:locale</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:locale</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:billingagreementcustom</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:custom_code</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:custom_code</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_get_agreement<span style="color:#006600; font-weight:bold;">&#40;</span>token<span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:token</span>, token<span style="color:#006600; font-weight:bold;">&#41;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_create_profile<span style="color:#006600; font-weight:bold;">&#40;</span>money, token, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:token</span>, token<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_amount<span style="color:#006600; font-weight:bold;">&#40;</span>post, money, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:subscribername</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:subscriber_name</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:subscriber_name</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:initamt</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:initamt</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:initamt</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:failedinitamtaction</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:failedinitamtaction</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span>  options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:failedinitamtaction</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profilestartdate</span>, <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">utc</span>.<span style="color:#9900CC;">iso8601</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:billingperiod</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:billing_period</span><span style="color:#006600; font-weight:bold;">&#93;</span> ? options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:billing_period</span><span style="color:#006600; font-weight:bold;">&#93;</span> : <span style="color:#996600;">&quot;Month&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:billingfrequency</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:billing_frequency</span><span style="color:#006600; font-weight:bold;">&#93;</span> ? options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:billing_frequency</span><span style="color:#006600; font-weight:bold;">&#93;</span> : <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:totalbillingcycles</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:billing_cycles</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:billing_cycles</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profilereference</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:reference</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:reference</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:autobillamt</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:auto_bill_amt</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:auto_bill_amt</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:maxfailedpayments</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:max_failed_payments</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:max_failed_payments</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:shippingamt</span>, amount<span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#ff3333; font-weight:bold;">:allow_blank</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:taxamt</span>, amount<span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:tax_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#ff3333; font-weight:bold;">:allow_blank</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:tax_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_shipping_address<span style="color:#006600; font-weight:bold;">&#40;</span>post, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_address</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_address</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_get_profile_details<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profileid</span>, profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_manage_profile<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, action, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profileid</span>, profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:action</span>, action<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:note</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:note</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:note</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_update_profile<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profileid</span>, profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:note</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:note</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:note</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:desc</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:description</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:description</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:subscribername</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:subscriber_name</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:subscriber_name</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profilereference</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:reference</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:reference</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:additionalbillingcycles</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:additional_billing_cycles</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:additional_billing_cycles</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_amount<span style="color:#006600; font-weight:bold;">&#40;</span>post, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:money</span><span style="color:#006600; font-weight:bold;">&#93;</span>, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:shippingamt</span>, amount<span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#ff3333; font-weight:bold;">:allow_blank</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:autobillamt</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:auto_bill_amt</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:auto_bill_amt</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:maxfailedpayments</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:max_failed_payments</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:max_failed_payments</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:taxamt</span>, amount<span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:tax_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#ff3333; font-weight:bold;">:allow_blank</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:tax_amount</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        add_shipping_address<span style="color:#006600; font-weight:bold;">&#40;</span>post, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_address</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:shipping_address</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_bill_outstanding<span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, money, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        post = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:profileid</span>, profile_id<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_amount<span style="color:#006600; font-weight:bold;">&#40;</span>post, money, options<span style="color:#006600; font-weight:bold;">&#41;</span>
        add_pair<span style="color:#006600; font-weight:bold;">&#40;</span>post, <span style="color:#ff3333; font-weight:bold;">:note</span>, options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:note</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:note</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        post
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> build_response<span style="color:#006600; font-weight:bold;">&#40;</span>success, message, response, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        PaypalExpressNvResponse.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>success, message, response, options<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>With this class installed using Active Merchant to set up a subscription / recurring payment through PayPal Express Checkout is easy. Firstly setup your gateway object:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gw = <span style="color:#6666ff; font-weight:bold;">ActiveMerchant::Billing::PaypalExpressRecurringNvGateway</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#ff3333; font-weight:bold;">:login</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'PAYPALEMAIL'</span>, <span style="color:#ff3333; font-weight:bold;">:password</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'PASSWORD'</span>, <span style="color:#ff3333; font-weight:bold;">:signature</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'PAYPALAPISIGNATURE'</span> <span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Then make a request to PayPal to setup the recurring payment. At this stage you pass through a description (which is what is shown to the user when they are asked to authorise the subscription so make it descriptive) and you also need to provide URLs on your site, that PayPal should redirect the subscriber back to when they either complete the payment, or alternatively if they choose to cancel.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">response = gw.<span style="color:#9900CC;">setup_agreement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Subscription £25 per month&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:cancel_return_url</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;https://mysite.com/cancel&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:return_url</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;https://mysite.com/complete&quot;</span> <span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>The request above returns us a token in the response from paypal and at this point we need to redirect the user to PayPal to authorise this subscription. The user will see the description &#8220;Subscription £25 per month&#8221; as sent in the previous request. We need to redirect the subscriber to PayPal using the following line of ruby:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">redirect_to gw.<span style="color:#9900CC;">redirect_url_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>response.<span style="color:#9900CC;">token</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Once the user has authorised the subscription they are returned to the :return_url we specified earlier, at which point we can create the actual subscription using the following:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">response = gw.<span style="color:#9900CC;">create_profile</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2500</span>, response.<span style="color:#9900CC;">token</span>, <span style="color:#ff3333; font-weight:bold;">:currency</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;GBP&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:reference</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;34&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Note: PayPal are really confusing having one API for the US and another for the UK but if you are using PayPal Express (which is free) independently of PayPal Website Payments Pro (Which you need to pay for) the US PayPal Express API works for all countries (apart from Germany I believe) and as you can see above I am passing in the UK currency. I am using the US API and I have a UK PayPal account. Also note that I have passed in a reference (I have an IPN URL setup in my PayPal account &#8211; Unfortunately you cannot pass an IPN URL with the request) to be sent in the IPN.</p>
<p>The previous step completes the set up of our Subscription. However if we need to later get information on the subscription or change it, we need to extract the Profile ID from the response as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">profile_id = response.<span style="color:#9900CC;">params</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;profileid&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>With this profile_id we can then later use these additional methods that I have included, such as getting details of the subscription profile using:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gw.<span style="color:#9900CC;">get_profile_details</span><span style="color:#006600; font-weight:bold;">&#40;</span>profile_id<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Update the subscription using various options (i.e. changing subscription amount shown below):</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gw.<span style="color:#9900CC;">update_profile</span><span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, <span style="color:#ff3333; font-weight:bold;">:money</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#006666;">3000</span>, <span style="color:#ff3333; font-weight:bold;">:currency</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;GBP&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Manage the subscription, for example cancel it as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gw.<span style="color:#9900CC;">manage_profile</span><span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, <span style="color:#996600;">&quot;Cancel&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:note</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;Your subscription has been cancelled by us&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>And finally bill any outstanding subscription balance:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gw.<span style="color:#9900CC;">bill_outstanding</span><span style="color:#006600; font-weight:bold;">&#40;</span>profile_id, <span style="color:#006666;">2500</span>, <span style="color:#ff3333; font-weight:bold;">:currency</span>=<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;GBP&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:note</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">&quot;£20 Overdue Subscription&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Please note that as of yet this class is not part of Active Merchant, however it has been added to <a href="http://jadedpixel.lighthouseapp.com/projects/11599-active-merchant/tickets/17-patch-creating-paypal-recurring-payments-profile-with-activemerchant#ticket-17-4">Active Merchants case #17</a> If you want to use this you will have to add it manually as above.</p>
<p>I recommend reading <a href="https://www.paypal.com/en_US/pdf/PP_ExpressCheckout_IntegrationGuide.pdf">PayPals Express Checkout Integration Guide</a> and the <a href="https://www.paypal.com/en_US/pdf/PP_NVPAPI_DeveloperGuide.pdf">Name Value Pair API Developer Guide and Reference</a> for more information on what variables can be passed in each request to PayPal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2008/09/08/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Review: Chat Widget for your Blog, Powered by Adobe Flex</title>
		<link>http://www.gotripod.com/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/</link>
		<comments>http://www.gotripod.com/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 11:21:41 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex and Air]]></category>
		<category><![CDATA[RIAs]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/</guid>
		<description><![CDATA[Following my previous article I discovered Chatopica an excellent chat widget, you can integrate directly into your blog. Current topics are related to programming and design but custom topics are coming soon.
Chatopica is created by Tom Bray and Robert Cadena of SearchCoders, Tom being the presenter of the excellent eSeminar on an Easy MVC approach [...]]]></description>
			<content:encoded><![CDATA[<p>Following my <a href="http://www.www.gotripod.com/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex">previous article</a> I discovered <a href="http://www.chatopica.com/">Chatopica</a> an excellent chat widget, you can integrate directly into your blog. Current topics are related to programming and design but custom topics are coming soon.</p>
<p><a href="http://www.chatopica.com/">Chatopica</a> is created by <a href="http://www.tombray.com/">Tom Bray</a> and <a href="http://www.machine501.com/">Robert Cadena</a> of <a href="http://www.searchcoders.com/">SearchCoders</a>, Tom being the presenter of the excellent eSeminar on an <a href="http://www.www.gotripod.com/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex">Easy <span class="caps"><span class="caps">MVC</span></span> approach to developing flex apps, I blogged about</a>.</p>
<div class="contentbar_header">&nbsp;</div>
<div class="contentbar_body" align="center">
<script src="http://www.chatopica.com/embed.js?room=flex&#038;width=500&#038;height=650&#038;bgcolor=222222"></script><br/>
</div>
<div class="contentbar_footer">&nbsp;</div>
<p><span id="more-6"></span></p>
<h2>What you can currently chat about in Chatopica</h2>
<p>Currently Chatopica offers the following topics, but the guys are working on the ability to create custom topics and you can register to be notified when this feature is added <a href="http://www.chatopica.com/">on their homepage</a> :</p>
<ol>
<li>Adobe Flash (Flash Programming and Design)</li>
<li>Adobe Flex (Flex Programming)</li>
<li>Adobe Photoshop</li>
<li><span class="caps"><span class="caps">AJAX</span></span> (AJAX Programming)</li>
<li>Book Club (Discussions on Books and Novels)</li>
<li>Chatopica (Chatopica)</li>
<li>ColdFusion (ColdFusion Programming)</li>
<li>Java (Java Programming)</li>
<li><span class="caps"><span class="caps">PHP</span></span> (PHP Programming and Web Development)</li>
<li>Python (Pythonistas Unite!)</li>
<li>Ruby On Rails</li>
<li>Video Games</li>
</ol>
<p>I like the widget so much that I have added two topics to my own blog, so if you would like to chat with like minded developers about Ruby on Rails or Adobe Flex you can access these here anytime:</p>
<ul>
<li><a href="http://www.www.gotripod.com/flexchat">http://www.www.gotripod.com/flexchat</a> (For Adobe Flex Chat)</li>
<li><a href="http://www.www.gotripod.com/railschat">http://www.www.gotripod.com/railschat</a> (For Ruby on Rails CHat)</li>
</ul>
<p><em><strong>Note</strong></em> There are not many Rails developers on here yet, but if you are in the Rails community, please spead the word.</p>
<p>Or even better, why not add this widget to your own Flex or Rails blog / website!</p>
<h2>Adding a Chatopica topic to your own site..</h2>
<p>Adding Chatopica to your own site is a piece of cake, simply visit the <a href="http://www.chatopica.com/topics/">Chatopica Topics section</a>, choose the topic(s) you would like on your site and copy and paste the one line of Javascript into the <span class="caps"><span class="caps">HTML</span></span> of your page. For those that have added other widgets to your sites, you will be familiar with this. It’s that easy. (That’s why I pasted one into this article.)</p>
<h2>Overview of Features</h2>
<p>When Chatopica first loads, it automatically assigns you a guest ID. You can change this at any time by clicking on the assigned guest ID in the top bar and entering a new nicname / display name. If you enter a name currently in use, the system smartly handles duplicate by appending a unique ID to the duplicate name you entered. If you don’t like this you can simply change it to something else.</p>
<p>Another nice feature for developers is that you can click the code button and copy and paste in, some source code. Not only does chatopica colorize your code, it also folds it so those who are not interested in seeing the code can ignore it without it filling their chat screen, while those that are interested can click the {} icon to expand the source code.</p>
<p>Chatopica, like many chat clients automatically scrolls to the latests message posted. A nice feature to Chatopica is the ability to turn the Autoscroll feature off by clicking the padlick icon in the bottom right of the widget. This then prevents the chat window from scrolling to the bottom when someone posts a new message, which is handy while examining someones source code.</p>
<p>With the ability to create your own custom chat room coming soon, we will all be able to add a little peice of Chatopica to our websites and blogs.</p>
<h3>For more information</h3>
<ul>
<li><a href="http://www.chatopica.com/">Chatopica</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/10/19/review-chat-widget-for-your-blog-powered-by-adobe-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apple Leopard to be released 26th October</title>
		<link>http://www.gotripod.com/2007/10/17/apple-leopard-to-be-released-26th-october/</link>
		<comments>http://www.gotripod.com/2007/10/17/apple-leopard-to-be-released-26th-october/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 18:15:39 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Misc..]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/17/apple-leopard-to-be-released-26th-october/</guid>
		<description><![CDATA[For all you Apple Mac fans out there, Mac OS X 10.5\&#8217;92s release has been announced for the 26th October 2007 (As promised).
I have already pre-ordered my copy and looking forward to the 300 new features.
In particular:
Ruby on Rails &#8211; &#8220;Work in a developer&#8217;s dreamland. Leopard is the perfect platform for Ruby on Rails development, [...]]]></description>
			<content:encoded><![CDATA[<p>For all you Apple Mac fans out there, Mac <span class="caps">OS X 10</span>.5\&#8217;92s release has been announced for the 26th October 2007 (As promised).</p>
<p>I have already pre-ordered my copy and looking forward to the <a href="http://www.apple.com/macosx/features/300.html">300 new features</a>.</p>
<p>In particular:</p>
<p>Ruby on Rails &#8211; &#8220;Work in a developer&#8217;s dreamland. Leopard is the perfect platform for Ruby on Rails development, with Rails, Mongrel, and Capistrano built in&#8221;</p>
<p>For more information, <a href="http://www.apple.com">scoot over to Apple&#8217;s Website</a></p>
<p><img width="1" src="http://feeds.feedburner.com/~r/miletbaker/~4/171239300" height="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/10/17/apple-leopard-to-be-released-26th-october/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Mephisto Theme using Liquid</title>
		<link>http://www.gotripod.com/2007/10/10/creating-a-mephisto-theme-using-liquid/</link>
		<comments>http://www.gotripod.com/2007/10/10/creating-a-mephisto-theme-using-liquid/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 20:51:26 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[mephisto]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[UI Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/15/creating-a-mephisto-theme-using-liquid/</guid>
		<description><![CDATA[Mephisto is an excellent blogging platform written in Ruby on Rails by Rick Olsen and Justin Palmer both of whom are behind the excellent Lighthouse Issue Tracking Software . This article / tutorial takes you step by step through the process of creating a custom theme / templates.
To an extent I am going to assume [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mephistoblog.com/">Mephisto</a> is an excellent blogging platform written in Ruby on Rails by <a href="http://weblog.techno-weenie.net/">Rick Olsen</a> and <a href="http://alternateidea.com/">Justin Palmer</a> both of whom are behind the excellent <a href="http://lighthouseapp.com/">Lighthouse Issue Tracking Software</a> . This article / tutorial takes you step by step through the process of creating a custom theme / templates.</p>
<p>To an extent I am going to assume you are already familiar with Ruby and the Rails Web Development Framework, but where possible I hope to keep things as simple as possible.</p>
<p>First of all one of the best ways to go about learning how to create a custom template / theme is to download one of the existing themes you like from the <a href="http://mephisto-themes.nanorails.com/gallery">Mephisto Themes Gallery</a> and look inside the .zip file and see how these template authors have gone about implementing their themes.</p>
<p><span id="more-10"></span></p>
<p>To get started you will need a copy of Mephisto to test your themes against. You can easily checkout the latest version from subversion. <a href="http://mephistoblog.com/docs/setup">Follow the instruction from the Mephisto Site</a> . Mephisto themes are stored under the /themes/ directory in your Rails application root. If you have a default single host installation, you need to create a new empty folder under /themes/site1/ . You can call the folder whatever you like, this is where we will create our theme.</p>
<p>Mephisto themes are made up of Liquid template files (basically html files with extra markup tags to inject content into your template), images used by your template as well as <span class="caps">CSS</span> stylesheets and Javascript files.</p>
<h2>Understanding liquid files</h2>
<p>Liquid files were created by the developers at <a href="http://www.shopify.com/">Shopify</a> so that their users could customize their shops. These templates work exactly as Rails .rhtml files do however they are safe in the sense that if a variable is nil or undefined they don’t throw an exception or server error, they simply do not generate any content. For non Rails developers .rhtml files store the html for pages and have special &lt;% <span>&gt; tags where Ruby code can be entered and &lt;</span>= <span>&gt; tags where we can output to the page. Liquid files are pretty much the same, however instead of &lt;</span> <span>&gt; tags we have {</span> <span>} and instead of &lt;</span>= %&gt; we have {{ }} tags.</p>
<p><a href="http://jadedpixel.stikipad.com/design/show/UsingLiquid">More information can be found on Shopify’s Site</a> and I recommend you read through this, in addition to this article.</p>
<p>Mephisto provides a variety of variable that can be used not only to put content on the page, but also to generate the navigation links, to link between pages. For example in the template that is used to display an article such as this, we have a {{ }} tags which specify to output the article body text like this {{ article.body }}.</p>
<h3>Iteration</h3>
<p>If the item is an array we can loop through each element using the following:</p>
<ol class="CodeRay">
<li>{% for blog_section in site.blog_sections <span>}</span></li>
<li>      {{ blog_section.name }}</li>
<li>{ endfor %}</li>
</ol>
<h3>Conditions</h3>
<p>We can also test the values in these Liquid variables and conditionally display content:</p>
<ol class="CodeRay">
<li>{% if section.is_home <span>}</span></li>
<li>     Welcome to the site…</li>
<li>{ endif %}</li>
</ol>
<h2>Variable Reference</h2>
<p>Before we get into creating templates there are two places to look for the Liquid variables available in Mephisto, <a href="http://mephistoblog.com/docs/templates/variable-reference">directly on Mephisto’s Site</a> and also on <a href="http://mephisto.stikipad.com/help/show/Overview+of+Mephisto+Tags">Mephisto’s old Wiki</a></p>
<p>There are various examples on how to do things like formatting dates etc., especially in the latter link above.</p>
<h2>Structure of Mephisto</h2>
<p>In addition to being simply a blog, Mephisto provides a Content Management System, this allows you to create content pages, such as an about page or portfolio <del>(At the time of writing, something I am still meaning to do <img src='http://www.gotripod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</del></p>
<p>When we design a theme, we need to bear these different types of content (blog / pages) in mind.</p>
<h2>Required Liquid Files</h2>
<p>To make up a theme, Mephisto looks for a minimum of the following files, which need to be stored in a folder called ‘templates’ within the folder you created above under /themes/site1/. You need to be careful the folder is spelt exactly as written here as this is where Mephisto will look.</p>
<ul>
<li><em><strong>section.liquid</strong></em> – The template is used for blog sections and normally show several articles, this template is generally also used as the template for your home page.</li>
<li><em><strong>single.liquid</strong></em> – The template used for showing a single article, often we only show short articles or excerpts in the blog sections above.</li>
<li><em><strong>tag.liquid</strong></em> – The template used to show articles for a particular tag.</li>
<li><em><strong>search.liquid</strong></em> – The template used to display search results.</li>
<li><em><strong>archive.liquid</strong></em> – The template used to display articles for a particular month.</li>
<li><em><strong>error.liquid</strong></em> – The template used to show a custom error, when an article or resource is not found.</li>
</ul>
<h3>layout.liquid</h3>
<p>In addition to the above templates, we have an overall template which provides content for every page called layout.liquid where we can put our main look and feel. This file is located, not in ‘templates’ as above, but in a subfolder (again within out theme) called ‘layouts’.</p>
<h2>Creating a layout template (layout.liquid)</h2>
<p>As mentioned above, this file is located within the layouts folder in our theme folder. This file is used no matter where we are in the blog so we can use it to put any content that appears on every page, for example the header with logos and in my case my search form, our side bars and footer. This page is also the only page that holds the html head and body tags, so at a minimum we need:</p>
<ol class="CodeRay">
<li><span class="pp">&lt;!DOCTYPE html <span class="caps">PUBLIC</span> &#8220;-//W3C//DTD <span class="caps">XHTML 1</span>.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;</span></li>
<li><span class="ta">&lt;html&gt;</span></li>
<li>    <span class="ta">&lt;head&gt;</span></li>
<li>        <span class="ta">&lt;title&gt;</span>My Blog<span class="ta">&lt;/title&gt;</span></li>
<li>    <span class="ta">&lt;/head&gt;</span></li>
<li>    <span class="ta">&lt;body&gt;</span></li>
<li>        {{ content_for_layout }}</li>
<li>    <span class="ta">&lt;/body&gt;</span></li>
<li><span class="ta">&lt;/html&gt;</span></li>
</ol>
<h3>Head Section</h3>
<p>Instead of having a static page title, we can dynamically insert the site title or if we are looking at a blog article, the article’s title is displayed. This not only gives the users a better experience but also shows as the title for search engine listings and in stats services such as <a href="http://www.feedburner.com/">Feedburner</a></p>
<ol class="CodeRay">
<li><span class="ta">&lt;title&gt;</span>{{ site.title }} {% if article <span>} – {{ article.title }} {</span> else <span>} {{ site.subtitle }} {</span> endif %}<span class="ta">&lt;/title&gt;</span></li>
</ol>
<p>Above we are displaying the site title, and if we are viewing an article, the article object is available, so we can show the title or we show the site subtitle, as set in the Admin Settings.</p>
<p>We also want to make sure our <span class="caps"><span class="caps">RSS</span></span> feed to be auto discoverable to browsers etc, so we want to add the following to our head section:</p>
<ol class="CodeRay">
<li>{{ head.feed }}</li>
<li><span class="c">&lt;!<del>—</del> If you are using feed burner, set it up with your <span class="caps">RSS</span> feed http://yourdomain/feed  then use the feedburner address <del>—</del>&gt;</span></li>
<li><span class="ta">&lt;link</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">http://feeds.feedburner.com/miletbaker</span><span class="dl">&#8220;</span></span> <span class="an">title</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Jon Milet Baker’s Blog</span><span class="dl">&#8220;</span></span> <span class="an">type</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">application/rss+xml</span><span class="dl">&#8220;</span></span> <span class="an">rel</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">alternate</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
</ol>
<p>We also want to reference any external Javascript or Stylesheet files by using the following tags:</p>
<ol class="CodeRay">
<li>{{ ‘stylesheetfilename’ | stylesheet }}</li>
<li>{{ ‘javascriptfilename’ | javascript }}</li>
</ol>
<h3>Body Section</h3>
<p>In layout.liquid we want to create our navigation links to access the different page or blog sections. I generally create navigation using unordered list tags , styling them using css. I can then generate the list items I need using a liquid iteration as below:</p>
<ol class="CodeRay">
<li><span class="ta">&lt;ul&gt;</span></li>
<li>    {% for section in site.page_sections <span>}</span></li>
<li>        <span class="ta">&lt;li&gt;</span><span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ section.url }}</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>{{ section.name }}<span class="ta">&lt;/a&gt;</span><span class="ta">&lt;/li&gt;</span></li>
<li>    { endfor %}</li>
<li><span class="ta">&lt;/ul&gt;</span></li>
</ol>
<p>The above, creates links to our page sections, we can also create links to the blog sections by changing line 2 to:</p>
<ol class="CodeRay">
<li>    {% for section in site.blog_sections %}</li>
</ol>
<p>We also likely want to add a search box to every page, we want to add the following:</p>
<ol class="CodeRay">
<li><span class="ta">&lt;form</span> <span class="an">method</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">get</span><span class="dl">&#8220;</span></span> <span class="an">action</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">/search</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span></li>
<li>  <span class="ta">&lt;input</span> <span class="an">type</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">text</span><span class="dl">&#8220;</span></span> <span class="an">class</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">search</span><span class="dl">&#8220;</span></span> <span class="an">value</span>=<span class="s"><span class="dl">&#8220;</span><span class="dl">&#8220;</span></span> <span class="an">name</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">q</span><span class="dl">&#8220;</span></span> <span class="an">id</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">q</span><span class="dl">&#8220;</span></span> <span class="an">size</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">15</span><span class="dl">&#8220;</span></span><span class="ta">/&gt;</span></li>
<li><span class="ta">&lt;/form&gt;</span></li>
</ol>
<p>As we would likely have the side bar defined in this file we would need to use the technique we used to conditionally display the title, for conditionally displaying content in the side bar. One example for this is displaying related articles to the current article. My related articles technique lists other articles tagged with the same tags. We can do this as follows:</p>
<ol class="CodeRay">
<li>{% if article <span>}</span></li>
<li>    {{ article.tags | tagged_articles | assign_to: ‘rel_articles’}}</li>
<li>    { for rel_article in rel_articles limit: 5 <span>}</span></li>
<li>        <span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">‘</span><span class="k">{{rel_article.url}}</span><span class="dl">‘</span></span><span class="ta">&gt;</span>{{ rel_article.title }}</li>
<li>    { endfor <span>}</span></li>
<li>{ endif %}</li>
</ol>
<p>The above code only shows when an article is being displayed, we pass all the tags for the current article and send it to a Mephisto function which returns a collection of articles, which we in turn store in a variable called rel_articles.</p>
<p>In addition to showing related articles we can also show our archive links using the following (in this case we only want this to display in a section):</p>
<ol class="CodeRay">
<li>{% for month in section.months <span>}</span></li>
<li>    {{ section | monthly_articles: month | size | assign_to: ‘articles_count’ }}</li>
<li>    { if articles_count <span class="er">&gt;</span> 0 <span>}</span></li>
<li>    <span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ section.path }}/{{ section.archive_path }}/{{ month | strftime: </span><span class="dl">&#8220;</span></span><span class="er"></span><span class="an">Y</span><span class="er">/</span><span class="er"><span></span><span class="an">m</span><span class="er">&#8220;</span> <span class="er">}</span><span class="er">}</span><span class="er">&#8220;</span><span class="ta">&gt;</span>{{ month | strftime: &#8220;%B %Y&#8221; }} ( {{ articles_count }} )<span class="ta">&lt;/a&gt;</span></span></li>
<li>    { endif <span>}</span></li>
<li>{ endfor %}</li>
</ol>
<p>You may also like to add a list of tags here. My site uses the <a href="http://ralree.info/2007/2/25/mephisto-tag-cloud-plugin">Mephisto Tag Cloud plugin by Hank</a> to generate different sized tag links based on their use, You could use the <a href="http://technorati.com/">Technorati Widget</a> or simply list all the site tags using:</p>
<ol class="CodeRay">
<li>{{ site | linked_tag_list }}</li>
</ol>
<p>Now we have a basic layout template that contains our common page content, we can get on with the individual templates.</p>
<h2>Section template (section.liquid)</h2>
<p>The sectiom template as mentioned before acts as the index or contents page for your blog items for each blog section, including the home section. Here you have access to not only the site level variable, but also the Section variables.</p>
<ol class="CodeRay">
<li>{% if articles.size <span class="er">&gt;</span> 0 <span>}</span></li>
<li>  <span class="ta">&lt;h1&gt;</span>Articles<span class="ta">&lt;/h1&gt;</span></li>
<li>  { for article in articles <span>}</span></li>
<li>    <span class="c">&lt;!<del>—</del> Within this loop we have access to the article variables. We will need to display each article and some useful properties</span></li>
<li><span class="c">           of the article variable are shown below:—&gt;</span></li>
<li>    {{ article | link_to_article }}</li>
<li>    {{ article.published_at | date: ‘%b %d’ }}</li>
<li>    {{ article.author.login }}</li>
<li>    {{ article | linked_tag_list }}</li>
<li>    <span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ article.url }}#comments</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>{{ article.comments_count | pluralize: ‘comment’ }}<span class="ta">&lt;/a&gt;</span></li>
<li>    {{ article.body | textilize }}</li>
<li>  { endfor <span>}</span></li>
<li>{ else <span>}</span></li>
<li>  <span class="ta">&lt;p&gt;</span>No articles found.<span class="ta">&lt;/p&gt;</span></li>
<li>{ endif %}</li>
</ol>
<p>Line 10 allows us to display the number of comments with a link to the part of the page where our comments are located, note the use of pluralize that automatically pluralizes the work comment, based on the number of comments, i.e. “1 comment” or “2 comments”.</p>
<p>Also as this is our contents page and we may have long articles rather than use the {{ article.body | textilize }} at line 11, Mephisto provides us with the functionality to write an excerpt. We can write a conditional statement that outputs the articles excerpt (if one exists) or the artilces body for shorter articles. This then requires you to Add an excerpt when writing longer articles, for example this article has all the text up to the ‘Understanding liquid files’ heading in the excerpt. The rest of the text is in the body.</p>
<p>We can then replace {{article.body | textilize }} with :</p>
<ol class="CodeRay">
<li>{% if article.excerpt.size <span class="er">&gt;</span> 0 <span>}</span></li>
<li>  {{ article.excerpt | textilize }}</li>
<li>  <span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">‘</span><span class="k">{{ article.url }}</span><span class="dl">‘</span></span> <span class="ta">&gt;</span>More…<span class="ta">&lt;/a&gt;</span><span class="ta">&lt;br</span><span class="ta">/&gt;</span><span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>{ else <span>}</span></li>
<li>  {{ article.body | textilize }}</li>
<li>{ endif %}</li>
</ol>
<p><em>Note: I have found that the Mephisto feed outputs the article.excerpt followed by the article.body for each article. So I have found the best way to handle this is to use the excerpt to create a divider for long articles and not have the text in the excerpt repeated in the article. However it is up to you how you implement this, you could output the article excerpt for article in quotes at the top of your article, literally as an excerpt as an excerpt of the body text.</em></p>
<h2>Single template (single.liquid)</h2>
<p>The single.layout template is used to display a particular blog item. It is also used by default to display page items.</p>
<p>On this page we have access to the variables in the article object and want to have the following output to the page:</p>
<ol class="CodeRay">
<li><span class="ta">&lt;h1&gt;</span>{{ article.title }}<span class="ta">&lt;/h1&gt;</span></li>
<li><span class="ta">&lt;p&gt;</span>Posted: {{ article.published_at | date: ‘%d %B %Y’ }}, by {{ article.author.login }}<span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>Tags: {{ article | linked_tag_list }}<span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>Comments: <span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ article.url }}#comments</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>{{ article.comments_count | pluralize: ‘comment’ }}<span class="ta">&lt;/a&gt;</span><span class="ta">&lt;/p&gt;</span></li>
<li>{{ article.excerpt | textilize }}</li>
<li>{{ article.body | textilize }}</li>
</ol>
<p>Above we list the article title, when it was published and by who along with the tags. As I am using the excerpt as to separate large articles I simple output the excerpt, immediately followed by the body text. If there is no excerpt only the body text is output.</p>
<p>In addition to the above we will want the ability for people to add comments to our articles (and I suggest you sign up for and use Akismet).</p>
<p>We need to add the following code to display out comments:</p>
<ol class="CodeRay">
<li><span class="ta">&lt;a</span> <span class="an">name</span>=<span class="s"><span class="dl">‘</span><span class="k">comments</span><span class="dl">‘</span></span><span class="ta">&gt;</span><span class="ta">&lt;/a&gt;</span></li>
<li>{% if article.comments.size != 0 <span>}</span></li>
<li>  { for comment in article.comments <span>}</span></li>
<li>    {{ comment.author_link }}</li>
<li>    {{ comment.published_at | date: ‘%d %B %Y’ }}</li>
<li>    {{ comment.body | textilize }}</li>
<li>  { endfor <span>}</span></li>
<li>{ endif %}</li>
</ol>
<p>The a tag at the top is used so that when a user navigates to the article url #comments they are taken directle to the required location on the page. You can also include the <a href="http://gravatar.com/">Gravatar</a> of the commentor, if they have set one up using the following tag within the for loop above:</p>
<ol class="CodeRay">
<li>{{ comment | gravatar: 80, &#8220;/images/mephisto/avatar.gif&#8221; }}</li>
</ol>
<p>The numeric value 80 is the size of the gravatar display, you can specify any size upto 80px</p>
<p>We also need to provide the user with a form to add comments if we are still accepting comments on that article, we do this as follows:</p>
<ol class="CodeRay">
<li>{% commentform <span>}</span></li>
<li><span class="c">&lt;!<del>- comment form -</del>&gt;</span></li>
<li>  <span class="ta">&lt;label</span> <span class="an">for</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">comment_author</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>Nick Name<span class="ta">&lt;/label&gt;</span><span class="ta">&lt;br</span><span class="ta">/&gt;</span>{{ form.name }}<span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>  <span class="ta">&lt;label</span> <span class="an">for</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">comment_author_email</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>Email (optional)<span class="ta">&lt;/label&gt;</span><span class="ta">&lt;br</span><span class="ta">/&gt;</span>{{ form.email }}<span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>  <span class="ta">&lt;label</span> <span class="an">for</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">comment_author_url</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>Website (optional)<span class="ta">&lt;/label&gt;</span><span class="ta">&lt;br</span><span class="ta">/&gt;</span>{{ form.url }}<span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>  <span class="ta">&lt;label</span> <span class="an">for</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">comment_body</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>Let the thoughts flow….<span class="ta">&lt;/label&gt;</span><span class="ta">&lt;br</span><span class="ta">/&gt;</span>{{ form.body }}<span class="ta">&lt;br</span><span class="ta">/&gt;</span></li>
<li>  <span class="ta">&lt;input</span> <span class="an">type</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">submit</span><span class="dl">&#8220;</span></span> <span class="an">value</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">Add</span><span class="dl">&#8220;</span></span> <span class="ta">/&gt;</span></li>
<li>{ endcommentform %}</li>
</ol>
<h2>Tag template (tag.liquid), Archive template (archive.liquid) &amp; Search template (search.liquid)</h2>
<p>There are three ways users can find articles on your blog using Mephisto, using the tag facility to find articles tagged under a particular tag, the archive facility to find articles by date and the search facility.</p>
<p>All of these will generally look the same and will likely simply list page titles and dates and perhaps the body or excerpt content, as we did for the section.layout template.</p>
<p>In addition we may want to list the number of articles, for example using</p>
<ol class="CodeRay">
<li>{{articles.size | pluralize: ‘article’ }} found.</li>
</ol>
<h3>Paging</h3>
<p>Mephisto will only display the number of items on a page as specified in the Admin Settings. Unfortunately Mephisto only implements paging on the search template when used in conjunction with a search. Here we can add to search.liquid the following to allow users to navigate through the pages.</p>
<ol class="CodeRay">
<li>{% if previous_page != &#8220;&#8221; <span>}<span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ previous_page }}</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span><span class="er">&lt;</span> Previous Page <span class="ta">&lt;/a&gt;</span>{</span> endif <span>} {</span> if next_page != &#8220;&#8221; <span>}<span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ next_page }}</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>Next Page <span class="er">&gt;</span><span class="ta">&lt;/a&gt;</span>{</span> endif %}</li>
</ol>
<p>Because the articles.size contains the number of articles to output to the page, with searches that span multiple pages, we would not display the total number of articles found. In this case we need to chnage the example above from articles.size to search_count as follows:</p>
<ol class="CodeRay">
<li>{{search_count | pluralize: ‘article’ }} found.</li>
</ol>
<h2>Error template (error.liquid)</h2>
<p>The final template we need to create is the error.liquid template that displays whenever the user requests an article or resource that does not exist. It is good practice to give the user options to find what they are looking for, so I like to firstly display my recent articles, but also provide the search form (see layout.liquid) on the page too, allowing the user to search for the required content.</p>
<h2>Partials</h2>
<p>As with Rails if we have content that we will use on more than one Liquid template, we can store it in a partical and include it in the templates where needed, for example our tag, archive and search, all list our article listing in the same way. In this case, rather than repeat ourselves for each file we could include the heading in each of the tag, archive and search files and for the actual listing place the code that is repeated in a file called _articles.liquid, i.e.</p>
<ol class="CodeRay">
<li>{{ article | link_to_article }}</li>
<li>    {{ article.published_at | date: ‘%b %d’ }}</li>
<li>    {{ article.author.login }}</li>
<li>    {{ article | linked_tag_list }}</li>
<li>    <span class="ta">&lt;a</span> <span class="an">href</span>=<span class="s"><span class="dl">&#8220;</span><span class="k">{{ article.url }}#comments</span><span class="dl">&#8220;</span></span><span class="ta">&gt;</span>{{ article.comments_count | pluralize: ‘comment’ }}<span class="ta">&lt;/a&gt;</span></li>
</ol>
<p>and then in tag.liquid, archive.liquid and search.liquid include this file for each article in our articles object as follows:</p>
<ol class="CodeRay">
<li>{% include ‘article’ with articles %}</li>
</ol>
<h2>Distributing Templates</h2>
<p>Finally if we want to distribute our templates, or if you think you have a good template, why not upload it to the <a href="http://mephisto-themes.nanorails.com/gallery">Mephisto Theme Gallery</a> . To do this we need to package the contents of our theme direcory into a .zip file, but before we do this, we need to firstly create a preview image of our theme called preview.png in the root of our theme directory and also create a descriptor file that includes who you are, what the theme is called etc. This is stored in a file called about.yml and is defined in <span class="caps"><span class="caps">YAML</span></span> as follows:</p>
<ol class="CodeRay">
<li>title: ClockObj Theme</li>
<li>author: Jon Milet Baker</li>
<li>version: 1.0</li>
<li>homepage: http://www.gotripod.com</li>
<li>summary: THe theme for www.gotripod.com</li>
</ol>
<p>This article has hopefully been a useful overview to creating your own Mephisto theme. There are lots of resources not only on <a href="http://mephistoblog.com/">Mephisto’s site</a> but also on their <a href="http://mephisto.stikipad.com/help/">Wiki</a></p>
<h2>More Information</h2>
<ul>
<li><a href="http://mephistoblog.com/">Mephisto Blog</a></li>
<li><a href="http://mephisto.stikipad.com/help/">Mephisto Wiki</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/10/10/creating-a-mephisto-theme-using-liquid/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Tip: Running command line / shell commands in Ruby using %x</title>
		<link>http://www.gotripod.com/2007/10/07/tip-running-command-line-shell-commands-in-ruby-using-x/</link>
		<comments>http://www.gotripod.com/2007/10/07/tip-running-command-line-shell-commands-in-ruby-using-x/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 08:08:04 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/10/18/tip-running-command-line-shell-commands-in-ruby-using-x/</guid>
		<description><![CDATA[I thought I would post a very quick tip on how to execute a command line / shell command with Ruby. There are several ways to run command lines / shell commands in Ruby as discussed by Jay Fields however by far the most useful of these is the %x command, as follows:

@whois = %x[whois [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would post a very quick tip on how to execute a command line / shell command with Ruby. There are several ways to run command lines / shell commands in Ruby as discussed by <a href="http://blog.jayfields.com/2006/06/ruby-kernel-system-exec-and-x.html">Jay Fields</a> however by far the most useful of these is the %x command, as follows:</p>
<ol class="CodeRay">
<li><span class="iv">@whois</span> = <span class="sh"><span class="dl">%x[</span><span class="k">whois www.gotripod.com</span><span class="dl">]</span></span></li>
</ol>
<p>And what is important and not mentioned by Jay is the fact that you can pass parameters into %x[] as follows:</p>
<ol class="CodeRay">
<li>dom = <span class="s"><span class="dl">&#8216;</span><span class="k">www.gotripod.com</span><span class="dl">&#8216;</span></span></li>
<li><span class="iv">@whois</span> = <span class="sh"><span class="dl">%x[</span><span class="k">whois </span><span class="il"><span class="dl">#\{</span>dom<span class="dl">\}</span></span><span class="dl">]</span></span></li>
</ol>
<p><img src="http://feeds.feedburner.com/~r/miletbaker/~4/166620922" height="1" width="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/10/07/tip-running-command-line-shell-commands-in-ruby-using-x/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Live Validation &#8211; Custom Validator</title>
		<link>http://www.gotripod.com/2007/09/06/live-validation-custom-validator/</link>
		<comments>http://www.gotripod.com/2007/09/06/live-validation-custom-validator/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 21:51:27 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[UI Design]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/09/06/live-validation-custom-validator/</guid>
		<description><![CDATA[Following my article earlier today on Live Validation, I have had a response from Alec regarding how to create a custom validator to use with his Live Validation framework.
Having asked if a custom Validator could be passed in the .Now() function Alec had the following to say:
In regards to passing a custom validation method into [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gotripod.com/2007/9/6/live-validation-cross-platform-rails-style-validation-on-the-client">Following my article earlier today</a> on <a href="http://livevalidation.com">Live Validation</a>, I have had a response from Alec regarding how to create a custom validator to use with his <a href="http://livevalidation.com">Live Validation</a> framework.</p>
<p>Having asked if a custom Validator could be passed in the .Now() function Alec had the following to say:</p>
<p>In regards to passing a custom validation method into the .now method, it will not \&#8217;91create\&#8217;92 the validation method as such, but will accept one you have made, as long as your custom validation method takes a value as the first argument, and throws a Validate.Error exception when it fails (in order to pass on the failure message  made easier by using Validate.fail), and true if it passes. For example:</p>
<ol class="CodeRay">
<li>Validate.Example = <span class="r">function</span>(value, paramsObj)\{</li>
<li></li>
<li> <span class="c">// the following sets up default options and overides them with those passed in </span></li>
<li> <span class="r">var</span> params = <span class="pt">Object</span>.extend(\{</li>
<li> failureMessage: <span class="s"><span class="dl">&#8220;</span><span class="k">Default failre message goes in here!</span><span class="dl">&#8220;</span></span></li>
<li> \}, paramsObj || \{\});</li>
<li></li>
<li> <span class="c">// here you would check the value you wish to validate (the one passed in), against some expected value </span></li>
<li> <span class="c">// if it fails then use the Validate.fail method will throw an exception containing the failure message</span></li>
<li> <span class="r">if</span>(value != <span class="s"><span class="dl">&#8216;</span><span class="k">My expected value</span><span class="dl">&#8216;</span></span>) Validate.fail(params.failureMessage);</li>
<li></li>
<li> <span class="c">// if the script reaches this far then no exception has been thrown, so the validation passed </span></li>
<li> <span class="r">return</span> <span class="pc">true</span>;</li>
<li> \}</li>
</ol>
<p>Alec clarified: &#8220;&#8230;if you take a look at some of the included validation methods they contain calls to some of the other ones internally, as they will throw exceptions and halt proceedings if they fail, so act in much the same way as the simple one we have above. Validate.Email is a simple example of this and can be easily adapted to make a reusable postcode format validation for instance.&#8221;</p>
<p>Following Alec&#8217;s example above, you can easily then use the validator using the following:</p>
<ol class="CodeRay">
<li>Validate.now(Validate.Example(), value_to_validate, \{options\})</li>
</ol>
<p>Using a custom validator opens up many possibilities such as making an <span class="caps">AJAX</span> call to the server to check the uniqueness of a username or password.</p>
<p>For more information:</p>
<p><a href="http://www.livevalidation.com">Live Validation</a></p>
<p><a href="http://www.livevalidation.com/documentation#ValidateNow">Documentation for Validate.now()</a></p>
<p><img src="http://feeds.feedburner.com/~r/miletbaker/~4/153158057" height="1" width="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/09/06/live-validation-custom-validator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Live Validation &#8211; Cross Platform, Rails style validation on the client.</title>
		<link>http://www.gotripod.com/2007/09/06/live-validation-cross-platform-rails-style-validation-on-the-client/</link>
		<comments>http://www.gotripod.com/2007/09/06/live-validation-cross-platform-rails-style-validation-on-the-client/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 19:00:30 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[UI Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/09/06/live-validation-cross-platform-rails-style-validation-on-the-client/</guid>
		<description><![CDATA[I came across a great new validation library the other day which I wanted to share with you all. Live Validation by Alec Hill is a cross-platform client-side JavaScript validation framework which provides real-time feedback to the user as they type.
&#160;


LiveValidation in action

As I am currently reading the highly recommended Designing the Obvious: A Common [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a great new validation library the other day which I wanted to share with you all. <a href="http://livevalidation.com">Live Validation</a> by Alec Hill is a cross-platform client-side JavaScript validation framework which provides real-time feedback to the user as they type.</p>
<p class="contentbar_header">&nbsp;</p>
<p align="center" class="contentbar_body"><img src="http://farm2.static.flickr.com/1390/1336403025_7aa7f1cbc7.jpg" alt="val2" /><br/><br/><br />
<img src="http://farm2.static.flickr.com/1374/1337287656_d3d08ab65c.jpg" alt="val1" /></p>
<p class="contentbar_footer">LiveValidation in action</p>
<p><span id="more-15"></span></p>
<p>As I am currently reading the highly recommended <a href="http://www.amazon.com/gp/product/032145345X?ie=UTF8&amp;tag=clockobjec-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=032145345X">Designing the Obvious: A Common Sense Approach to Web Application Design</a><img border="0" width="1" src="http://www.assoc-amazon.com/e/ir?t=clockobjec-20&amp;l=as2&amp;o=1&amp;a=032145345X" height="1" style="margin: 0px; border: medium none" /> which discusses the use of Poka Yoke (Japanese for “mistake proofing”) devices on the web. One of which is the use of real-time validation to provide feedback to users as they make the error, rather than waiting to submit the form (which could extend beyond the screen) and finding that they cannot proceed. Sometimes searching for where they have made an error can be a challenge in itself! This client side validation library fits the bill nicely. Hoekman may argue that actually Alec is a little aggressive in his technique of pouncing on errors before the user has had a chance to get it right but I feel it is nice that the user can see as they type whether the field is valid.</p>
<p>Although this library seems clearly aimed at Rails developers (which I will elaborate on next) the library is fully cross platform/cross browser compatible, It has <a href="http://www.livevalidation.com/support">been tested</a> across a large cross section of browsers on different platforms and can be used with any server side technology such as <span class="caps"><span class="caps">PHP</span></span>, Ruby on Rails, <span class="caps"><span class="caps">ASP</span></span>, Java, Python etc.</p>
<p>I mentioned the library is aimed at Rails developers and this is because the naming of validators for the JavaScript library closely match those built into the Rails Framework. There are the following validators build in:</p>
<ol>
<li>Presence</li>
<li>Format (using Regular Expressions)</li>
<li>Numericality</li>
<li>Length</li>
<li>Inclusion</li>
<li>Exclusion</li>
<li>Acceptance</li>
<li>Confirmation</li>
<li>Email</li>
</ol>
<p>It is not clear if you can validate against a custom function, for example allowing you to create a <span class="caps"><span class="caps">AJAX</span></span> request to the server to check Uniqueness of user names or email addresses on a registration form [I will contact Alec to clarify]. Validations can be combined together on a single field, so for example you can check if a field is required or not. Another nice feature is that you can check whether the whole form has validated, allowing you to prevent submission to the form as suggested by Alec, or use this to only enable the submit button once the form is valid as advocated by Hoekman.</p>
<p>Setting up validation on a field is easy, for example to Validate presence you would need the following code:</p>
<ol class="CodeRay">
<li><span class="r">var</span> f1 = new LiveValidation(<span class="s"><span class="dl">‘</span><span class="k">f1</span><span class="dl">‘</span></span>);</li>
<li>f1.add( Validate.Presence );</li>
</ol>
<p>The script is available as a standalone version or for integration with <a href="http://www.prototypejs.org/">Prototype</a> and is released under the <span class="caps"><span class="caps">MIT</span></span> licence.</p>
<p>For more information see: <a href="http://livevalidation.com/">livevalidation.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/09/06/live-validation-cross-platform-rails-style-validation-on-the-client/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tktit.com &#8211; Running on Ruby on Rails</title>
		<link>http://www.gotripod.com/2007/09/05/tktit-com-running-on-ruby-on-rails/</link>
		<comments>http://www.gotripod.com/2007/09/05/tktit-com-running-on-ruby-on-rails/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 08:24:55 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[portfolio]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/09/05/tktitcom-running-on-ruby-on-rails/</guid>
		<description><![CDATA[TktIt.com is a self service ticketing solution for the social networking generation. It allows bands, clubs, companies etc to sell tickets, places to any event or activity they may run, for example gigs, training events, sports activities, festivals, exhibitions etc. Tickets can be sold directly from the users websites and payment is made directly to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tktit.com">TktIt.com</a> is a self service ticketing solution for the social networking generation. It allows bands, clubs, companies etc to sell tickets, places to any event or activity they may run, for example gigs, training events, sports activities, festivals, exhibitions etc. Tickets can be sold directly from the users websites and payment is made directly to PayPal, in addition users can track their ticket sales directly from TktIt.</p>
<p class="contentbar_header">&nbsp;</p>
<p class="contentbar_body"><img src="http://farm2.static.flickr.com/1238/1328479284_016b83a6de.jpg" /></p>
<p class="contentbar_footer">Tktit.com &#8211; The self service ticketing site.</p>
<p>This was my first full development outing into the realms of Ruby on Rails which has been an inspirational and educating experience and I will be posting several articles in the near future on some of the techniques I used such as using <a href="http://script.aculo.us/">script.aculo.us</a> to produce a similar color selector to the <a href="http://www.www.gotripod.com/2007/8/31/191">one I did in .Net/JQuery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/09/05/tktit-com-running-on-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Let the migration begin&#8230;</title>
		<link>http://www.gotripod.com/2007/09/03/let-the-migration-begin/</link>
		<comments>http://www.gotripod.com/2007/09/03/let-the-migration-begin/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 11:51:44 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Misc..]]></category>
		<category><![CDATA[george]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jon]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[UI Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://old.miletbaker.com/index.php/2007/09/04/let-the-migration-begin/</guid>
		<description><![CDATA[With my new focus on Rails, I have decided to move my blog to the excellent Mephisto Blog, from now on I will also be focusing my articles a little more towards not only Ruby on Rails but also Web Development, Web Design, UI Design and Javascript.
I have also used this opportunity to streamline the [...]]]></description>
			<content:encoded><![CDATA[<p>With my new focus on Rails, I have decided to move my blog to the excellent <a href="http://mephistoblog.com/">Mephisto Blog</a>, from now on I will also be focusing my articles a little more towards not only Ruby on Rails but also Web Development, Web Design, UI Design and Javascript.</p>
<p>I have also used this opportunity to streamline the design of the site, there were a few things that didn&#8217;t work quite as they should on the old site and will have been improved along with a revamp of the colour scheme.</p>
<p>As I write this <a href="http://www.miletbaker.com">www.miletbaker.com</a> still points to the old blog until all the content has been migrated and I have configured Apache to relay requests to my old urls to their new location. Once this is complete that will also be migrated across.</p>
<p><strike>Also look out for the Jive (Javascript Input Validation Engine) for Prototype which I am currently working on with <a href="http://lifeonrails.org">George</a> which will feature real time inline validation as well as validation calls via Ajax and a Rails plug in.</strike> Check out <a href="http://www.livevalidation.com/" target="_blank">Live Validation.</a></p>
<p><img src="http://feeds.feedburner.com/~r/miletbaker/~4/152138128" height="1" width="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotripod.com/2007/09/03/let-the-migration-begin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
