<?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>Web Development by Joe Sak &#187; Ruby on Rails</title>
	<atom:link href="http://www.joesak.com/category/programming/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joesak.com</link>
	<description>Rails, HTML5, CSS3, jQuery - Thoughts, Advice &#38; Work</description>
	<lastBuildDate>Tue, 27 Jul 2010 14:10:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Online Photo Gallery, Payment &amp; Order Fulfillment: Ruby on Rails Tutorial</title>
		<link>http://www.joesak.com/2009/09/18/online-photo-gallery-payment-order-fulfillment-ruby-on-rails-tutorial/</link>
		<comments>http://www.joesak.com/2009/09/18/online-photo-gallery-payment-order-fulfillment-ruby-on-rails-tutorial/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 16:51:04 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[Improving Code]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.joesak.com/?p=255</guid>
		<description><![CDATA[This post is a follow-up to the post on my personal blog, titled &#8220;Ruby on Rails Photo Gallery &#38; Shopping Cart with RESTful Authentication&#8221; In that article, I merely showed off what I&#8217;d done with Ruby on Rails, but I didn&#8217;t show anyone how. Well, I&#8217;ve gotten some comments from people asking me to show [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a follow-up to the post on <a title="Joe Sak's Web Development Blog" href="http://www.joesak.com">my personal blog</a>, titled &#8220;<a title="Ruby on Rails Photo Gallery &amp; Shopping Cart with RESTful Authentication" href="http://www.joesak.com/2009/05/31/ruby-on-rails-photo-gallery-shopping-cart-restful-authentication/">Ruby on Rails Photo Gallery &amp; Shopping Cart with RESTful Authentication</a>&#8221; In that article, I merely showed off what I&#8217;d done with Ruby on Rails, but I didn&#8217;t show anyone how. Well, I&#8217;ve gotten some comments from people asking me to show them how to build it.</p>
<p>That&#8217;s what this post is for.</p>
<p>So on to the nitty gritty details.</p>
<p>Start with the RESTful Authentication Tutorial:</p>
<p><script src="http://gist.github.com/189148.js"></script> <a></a> Follow the README to install, but <a title="Fix #1 to RESTful Authentication Install" href="http://railsforum.com/viewtopic.php?pid=96632#p96632">READ THIS FIRST</a> to fix the ExceptionLogger error  Then <a href="http://railsforum.com/viewtopic.php?pid=99223#p99223">follow these instructions</a> to fix the OpenID plugin error  Make sure you get your <a href="http://recaptcha.net/whyrecaptcha.html">recaptcha keys</a> for the config.yml, otherwise failed login attempts will bust your application.  Fill out the config &amp; database.yml files accordingly, run your database create &amp; migrate rakes, fire up the server and make sure it looks good. Cool? Let&#8217;s move on:  <strong>Define the objects</strong> Let&#8217;s begin by pointing out what, exactly, we&#8217;ll be building this application around: <strong>Galleries </strong>of <strong>Photos </strong>that <strong>Customers</strong> can order with a private <strong>Account</strong> provided to them by an <strong>Admin</strong> who can manage the galleries and review the <strong>Orders</strong>, which are also available to their respective customers.  I will go through how to set up the following models like so:</p>
<ul>
<li>Galleries
<ul>
<li>has_many :photos</li>
<li>belongs_to :customer</li>
<li>title</li>
<li>acts_as_urlnameable (pretty URLs)</li>
</ul>
</li>
<li>Photos
<ul>
<li>belongs_to :gallery</li>
<li>paperclip attachment: image</li>
</ul>
</li>
<li>Customers
<ul>
<li>username, password, full name</li>
</ul>
</li>
<li>Orders
<ul>
<li>has_many :line_items</li>
<li>belongs_to :customer</li>
</ul>
</li>
<li>Line Items
<ul>
<li>belongs_to <img src='http://www.joesak.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder</li>
<li>quantity, size, price</li>
</ul>
</li>
</ul>
<p>So let&#8217;s build the Galleries first:  <script src="http://gist.github.com/189161.js"></script></p>
<p>Then edit the Gallery model:</p>
<p><script src="http://gist.github.com/189149.js"></script> That&#8217;ll be fine for now. Let&#8217;s add the Photos model with paperclip image attached:  <script src="http://gist.github.com/189151.js"></script></p>
<p>Now edit the Photo model as such:</p>
<p><script src="http://gist.github.com/189152.js"></script> You should read all about <a href="http://thoughtbot.com/projects/paperclip">the paperclip gem</a> if you need more info on this model. Basically, we&#8217;re telling it to allow image attachments to the Photo model.  Customers can be the RESTful Authentication Tutorial User model, just need to add a couple things here:  <script src="http://gist.github.com/189153.js"></script></p>
<p>Let&#8217;s worry about Orders and Line Items later. We&#8217;ll have to add a cart, too. I&#8217;ll cover it, but it is all derived from <a href="http://www.pragprog.com/titles/rails3/agile-web-development-with-rails">Agile Web Development with Ruby on Rails Third Edition</a></p>
<p>Run your rake db:migrate and confirm all is well. Delete the Galleries layout file so it uses the application layout.</p>
<p>Let&#8217;s go see http://localhost:3000/galleries and play around. Add a gallery and then go to edit it. This is where we&#8217;ll add SWFUpload. <a href="http://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/">Follow Jim Neath&#8217;s advice for this</a>.</p>
<p>You&#8217;ll want a photos controller:</p>
<p><script src="http://gist.github.com/189155.js"></script> The create method I use is:  <script src="http://gist.github.com/189156.js"></script></p>
<p>I had no luck getting Jim Neath&#8217;s session fix working, so I put skip_before_filter :verify_authenticity_token in the Photos Controller. Bad? Yea, probably. I haven&#8217;t found a better way yet.</p>
<p>Add this code to app/views/galleries/edit.html.erb:</p>
<p><script src="http://gist.github.com/189157.js"></script> Which leads you to add the following partial: app/views/photos/_image.html.erb  <script src="http://gist.github.com/189159.js"></script></p>
<p>We&#8217;ll worry about the destroy link later, let&#8217;s integrate swfupload. <a href="http://code.google.com/p/swfupload/">Download the latest copy of SWFUpload</a>. Copy flash/swfupload.swf to public/flash (make directory first). Copy swfupload.js &amp; upload.js (in Jim Neath&#8217;s demo app) to public/javascripts. Copy Jim Neath&#8217;s swfupload.css file to public/stylesheets. Copy Jim Neath&#8217;s images/icons folder to public/images.</p>
<p>Add this code to app/views/galleries/edit.html.erb:</p>
<p><script src="http://gist.github.com/189160.js"></script></p>
<p>Yep, a lot is going on there. Reload your galleries/edit page and see if it&#8217;s still working <img src='http://www.joesak.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ok, so this gets you to a functioning online photo gallery. Up next will be adding user accounts, a shopping cart, ordering options, customers &amp; paypal integration. Stay tuned!</p>
<p>For now, please find the <a href="http://github.com/joemsak/proofs_package">source</a> here: <a href="http://github.com/joemsak/proofs_package">http://github.com/joemsak/proofs_package</a></p>
<p>And for help on your project, visit us at <a href="http://www.simplifyadvance.com">http://www.simplifyadvance.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2009/09/18/online-photo-gallery-payment-order-fulfillment-ruby-on-rails-tutorial/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My First Real-World Rails Project, Part II</title>
		<link>http://www.joesak.com/2008/11/20/my-first-real-world-rails-project-part-ii/</link>
		<comments>http://www.joesak.com/2008/11/20/my-first-real-world-rails-project-part-ii/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 17:16:56 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.joesak.com/?p=171</guid>
		<description><![CDATA[Continuing my series on my first real-world rails project, I&#8217;ve made some great advancements. Using attachment_fu, following Mike Clark&#8217;s Tutorial for Uploading / Resizing images in Ruby on Rails, and Rmagick with ImageMagick, I was able to add Categories functionality with featured images. I also used lightbox and Coda Slider for Admin &#38; Home presentations, [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing <a href="http://www.joesak.com/2008/11/10/real-world-rails-project-part-15/">my series on my first real-world rails project</a>, I&#8217;ve made some great advancements.</p>
<p>Using <a href="http://svn.techno-weenie.net/projects/plugins/attachment_fu/">attachment_fu</a>, following <a href="http://clarkware.com/cgi/blosxom/2007/02/24">Mike Clark&#8217;s Tutorial for Uploading / Resizing images in Ruby on Rail</a>s, and <a href="http://rmagick.rubyforge.org/">Rmagick</a> with <a href="http://www.imagemagick.org/script/index.php">ImageMagick</a>, I was able to add Categories functionality with featured images.</p>
<p>I also used <a href="http://www.lokeshdhakar.com/projects/lightbox2/">lightbox</a> and <a href="http://www.ndoherty.com/demos/coda-slider/1.1.1/">Coda Slider</a> for Admin &amp; Home presentations, respectively.</p>
<p>Enjoy!</p>
<p><a href="http://screencast.com/t/Jli6m3lzL">http://screencast.com/t/Jli6m3lzL</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2008/11/20/my-first-real-world-rails-project-part-ii/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Real World Rails Project, Part 1.5</title>
		<link>http://www.joesak.com/2008/11/10/real-world-rails-project-part-15/</link>
		<comments>http://www.joesak.com/2008/11/10/real-world-rails-project-part-15/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 16:10:52 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.joesak.com/?p=158</guid>
		<description><![CDATA[This is design iteration 1.5 of my first real world rails project. Read part I here. In this iteration I added drag and droppable table rows and a pricing table for the pricing page. Since I haven&#8217;t figured out how to update the db with the new sort orders reflected after the drag &#38; drop [...]]]></description>
			<content:encoded><![CDATA[<p>This is design iteration 1.5 of my first real world rails project. <a title="My first real world Rails project, part I" href="http://www.joesak.com/2008/11/08/my-first-real-world-rails-project-part-i/">Read part I here</a>.</p>
<p>In this iteration I added drag and droppable table rows and a pricing table for the pricing page.</p>
<p>Since I haven&#8217;t figured out how to update the db with the new sort orders reflected after the drag &amp; drop action, this is not considered iteration 2.</p>
<p>Enjoy:</p>
<p><a title="Beginner's Real World Rails Project, part 1.5" href="http://screencast.com/t/9bBPFCF3xp">http://screencast.com/t/9bBPFCF3xp</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2008/11/10/real-world-rails-project-part-15/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My First Real-World Rails Project part I</title>
		<link>http://www.joesak.com/2008/11/08/my-first-real-world-rails-project-part-i/</link>
		<comments>http://www.joesak.com/2008/11/08/my-first-real-world-rails-project-part-i/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 21:41:34 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.joesak.com/?p=154</guid>
		<description><![CDATA[I&#8217;ve decided to make a video series of my first real project in Ruby on Rails. My love of programming has been rekindled by this amazing language. It&#8217;s very true Rails was developed for the new Web. The conventions and defaults built into the framework are true genius and make any project simple, fun and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to make a video series of my first real project in <a title="Web development that doesn't hurt" href="http://www.rubyonrails.org">Ruby on Rails</a>. My love of programming has been rekindled by this amazing language. It&#8217;s very true Rails was developed for the new Web. The conventions and defaults built into the framework are true genius and make any project simple, fun and agile. I can respond to any change in scope at any stage of development and give my customers a competitive advantage.</p>
<p>I can truly value <a title="Read the Agile Manifesto and learn what happiness is" href="http://www.agilemanifesto.org">Customer Collaboration over contract negotiation</a> now.</p>
<p>Enjoy:</p>
<p><a title="A Beginner's first real-world Ruby on Rails project" href="http://screencast.com/t/rGDhWbVru">http://screencast.com/t/rGDhWbVru</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2008/11/08/my-first-real-world-rails-project-part-i/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails will Save Web Development</title>
		<link>http://www.joesak.com/2008/11/05/ruby-on-rails-will-save-web-development/</link>
		<comments>http://www.joesak.com/2008/11/05/ruby-on-rails-will-save-web-development/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 02:21:29 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work Stuff]]></category>

		<guid isPermaLink="false">http://www.joesak.com/?p=152</guid>
		<description><![CDATA[I&#8217;m investing time to learn Ruby on Rails and guess what? I&#8217;m becoming happier by the page.   Ruby on Rails is built on, emphasizes and aides developers in working according to the principles of the Agile Manifesto. I&#8217;ve never read anything more inspiring than those 12 principles. Rails has made it possible to skip [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m investing time to learn Ruby on Rails and guess what? I&#8217;m becoming happier by the page.</p>
<p> </p>
<p>Ruby on Rails is built on, emphasizes and aides developers in working according to <a title="Agile Manifesto" href="http://agilemanifesto.org/principles.html">the principles of the Agile Manifesto</a>. I&#8217;ve never read anything more inspiring than those 12 principles. Rails has made it possible to skip functional specs, comprehensive documents and all the other garbage that stops us from delivering working software to our customers that gives them a competitive advantage.</p>
<p>Rails allows you to respond to change rather than try to avoid it. Face it: clients change their minds. They forget to tell you some detail until the last week of development. They decide they don&#8217;t like their original ideas and want to try something new. In order for them to remain competitive, we need to be able to adapt and respond to those changes. So if you can&#8217;t control clients and stop this from happening, why would you continue to beat the dead horse? You write pages and pages of functional specs, scope docs and project plans. But I&#8217;ve never seen a single project completed without a change to any of those. It just doesn&#8217;t happen. Rails makes it easy to work with change, rather than constantly trying to figure out how to avoid it (you can&#8217;t).</p>
<p>Rails makes it possible to work and grow in a dynamic and competitive world. As I learn more, I&#8217;ll post more. Until then, I suggest you try Rails and see for yourself how much better your work can be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2008/11/05/ruby-on-rails-will-save-web-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 8/16 queries in 0.007 seconds using disk

Served from: www.joesak.com @ 2010-09-09 21:20:14 -->