<?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>Rails vs Whitewater &#187; Photify.net</title>
	<atom:link href="http://justinspowers.com/category/photify-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://justinspowers.com</link>
	<description>Whitewater enthusiast by day, Ruby on Rails programmer by night.</description>
	<lastBuildDate>Sat, 10 Dec 2011 07:42:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Out of sight, out of mind</title>
		<link>http://justinspowers.com/2009/12/out-of-sight-out-of-mind/</link>
		<comments>http://justinspowers.com/2009/12/out-of-sight-out-of-mind/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 15:19:54 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Photify.net]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Success]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=55</guid>
		<description><![CDATA[So today I set up observe_form for one of my search forms. I&#8217;ve been wanting to get rid of the submit button for my form, so that when users change a search field, it would just update the search results, in real time. Think kayak.com. It took surprisingly minimal work, and the result just feels [...]]]></description>
			<content:encoded><![CDATA[<p>So today I set up observe_form for one of my search forms.  I&#8217;ve been wanting to get rid of the submit button for my form, so that when users change a search field, it would just update the search results, in real time.  Think kayak.com.  It took surprisingly minimal work, and the result just feels good.  One problem though, is that nothing happens when I change the time slider on my form.<br />
<span id="more-55"></span><br />
First things first.  There isn&#8217;t such thing as a slider on a form (at least until you get to HTML5, I believe), so I hacked a solution in.  Using a custom javascript slider, whenever the user moves the slider, a hidden_field_tag gets updated, by tying into the onSlide callback of the slider.  This hidden field is passed along with the rest of the form upon submission.  However, this hidden field isn&#8217;t being observed as part of observe_form.  I suspect it&#8217;s because javascript is doing the updating, and not the user.  Either way, I couldn&#8217;t find a rails way of fixing it.  Here&#8217;s my observe_form as it stands today:</p>
<p><code>&lt;%= observe_form  'search-form',<br />
  :before =&gt; "Element.show('spinner')",<br />
  :complete =&gt; "Element.hide('spinner')",<br />
  :url =&gt; {:action => 'search'}<br />
  %&gt;</code></p>
<p>My solution was to hook into the onChange callback of the slider itself (ignoring the hidden fields).  I used onChange instead of onSlide because I didn&#8217;t want a dozen requests going to the server per slide.  I simply added the following javascript.</p>
<p><code>Element.show('spinner');<br />
new Ajax.Request('/search',{asynchronous:true,<br />
  evalScripts:true,<br />
  onComplete:function(request){Element.hide('spinner')},<br />
  parameters:Form.serialize('search-form')});</code></p>
<p>A simple note: I suck at javascript.  Not that I&#8217;m particularly dense, I just haven&#8217;t taken the time to learn it.  I simply gleaned this little gem by using firebug to see what Rails had generated using the aforementioned observe_form, and simply modified it slightly.  Win!</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/12/out-of-sight-out-of-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Of Capistrano, Github, and Branches (or, a forking mess)</title>
		<link>http://justinspowers.com/2009/10/of-capistrano-github-and-branches-or-a-forking-mess/</link>
		<comments>http://justinspowers.com/2009/10/of-capistrano-github-and-branches-or-a-forking-mess/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 01:58:25 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Efficiency]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Photify.net]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=23</guid>
		<description><![CDATA[Disclaimer: I am a Github newbie, and I am still learning the various concepts. If I misrepresent something in this post, please let me know in the comments! I recently switched my project over from SVN to Github. My reasons were varied, but a large reason was because I needed to create various branches to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer:</strong> I am a Github newbie, and I am still learning the various concepts.  If I misrepresent something in this post, please let me know in the comments!</p>
<p>I recently switched my project over from SVN to Github.  My reasons were varied, but a large reason was because I needed to create various branches to accomodate my ADD style of development (work on layouts for a bit, then switch to security, then switch to fine tuning my models).  I also need to create a branch for productions servers, as well as a branch for my staging server, which is set up at home.  The latter was a bit confusing at first, until I found a great tutorial <a href="http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage" onclick="pageTracker._trackPageview('/outgoing/weblog.jamisbuck.org/2007/7/23/capistrano-multistage?referer=');">here</a>.</p>
<p>First, a couple of notes about my setup.  I am the sole contributor to my (private) repository.  Up until now, I have not had a need for this &#8220;forking&#8221; business that I see from time to time.  In configuring up my multistage setup, I ran into an issue when I tried to use <code>set :branch, "2.0"</code> in my staging deploy.rb file.  Even though I had created a branch for &#8220;2.0&#8243; like so:<br />
<code>git branch 2.0</code><br />
I was getting the following error:<br />
<code>`query_revision': Unable to resolve revision for 'invalid' on repository 'git@github.com:*****/******.git'. (RuntimeError)</code><br />
This confused me for quite some time, until I found out that the set :branch isn&#8217;t referring to the branches that I had created locally, but to github forks.  To create a fork from the branch, I simply had to do the following:<br />
<code>git checkout 2.0<br />
git push origin 2.0</code></p>
<p>The origin bit is what does the magic.  As soon as I refreshed, I was able to see the newly created fork in the github web UI, and my deploy recipe worked like magic.  Brilliant!</p>
<p>Note: I still have to find out how this will affect my git workflow, but since the clone URL is still the same, it seems that I should still be able to continue with my current way of doing things.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/10/of-capistrano-github-and-branches-or-a-forking-mess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveMerchant nonsense</title>
		<link>http://justinspowers.com/2009/04/activemerchant-nonsense/</link>
		<comments>http://justinspowers.com/2009/04/activemerchant-nonsense/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 21:10:00 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[activemerchant]]></category>
		<category><![CDATA[Photify.net]]></category>
		<category><![CDATA[skipjack]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=5</guid>
		<description><![CDATA[I&#8217;ve been a little hesitant about putting in credit card processing into Photify.net, and it turns out is was with good reason.  The set up is just plain annoying!  Due to client needs, I had to go with Skipjack as my portal.  They seem relatively developer friendly, except that their customer service is about 50/50, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a little hesitant about putting in credit card processing into Photify.net, and it turns out is was with good reason.  The set up is just plain annoying!  Due to client needs, I had to go with Skipjack as my portal.  They seem relatively developer friendly, except that their customer service is about 50/50, literally.  I&#8217;ve called there several times during normal pacific hours, only to find out that in Eastern time I&#8217;m actually calling fairly late.  They only have two reps, one of which is helpless, and the other of which is knowleadgable and helpful.</p>
<p>After doing some digging, the best solution for processing payment in my rails app seems to be using ActiveMerchant.  It seems fairly well documented, at least if you are using a mainstream credit card processor like Authorize.net.  For skipjack though, it&#8217;s a little lacking.  For example, it&#8217;s not clear what, if anything, you need to put in the &#8216;password&#8217; field.  And no matter what I do, I can&#8217;t get any non-standard (by ActiveMerchant&#8217;s terms) fields to transmit, such as &#8220;comment&#8221;.  But perhaps the most frustrating thing of all, is when I had everything working and fine tuned in development, and I tried to throw the switch to production, by changing the login and using &#8220;:test =&gt; false&#8221; in the login hash.  After all, that is the only indication of where to send the transaction.  However, after several days of beating my head against the wall, I find this little gem (pardon the pun):</p>
<p><code>ActiveMerchant::Billing::Base.mode = :production</code></p>
<p>I almost slapped myself when I saw that.  Why in the world are there TWO places to set the mode?  Anyways, credit card processing now works, there is balance in the force, and everything is right in the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/04/activemerchant-nonsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

