{"id":371,"date":"2012-06-06T18:27:23","date_gmt":"2012-06-06T17:27:23","guid":{"rendered":"http:\/\/www.michaelokarimia.com\/blog\/?p=371"},"modified":"2014-12-28T18:33:22","modified_gmt":"2014-12-28T18:33:22","slug":"my-ruby-on-rails-photo-site-hosted-on-heroku","status":"publish","type":"post","link":"https:\/\/www.michaelokarimia.com\/blog\/2012\/06\/06\/my-ruby-on-rails-photo-site-hosted-on-heroku\/","title":{"rendered":"My Ruby on Rails photo site hosted on Heroku"},"content":{"rendered":"<p><a href=\"http:\/\/www.michaelokarimia.com\/blog\/2012\/06\/04\/net-web-apps-hosted-in-the-azure-cloud\/\" title=\".Net web apps hosted in the Azure cloud\" target=\"_blank\">In a previous post that I wrote on the topic of deploying web applications on to Azure cloud<\/a> I compared that to my experience of deploying <a href=\"http:\/\/rubyonrails.org\" target=\"_blank\">Ruby on Rails<\/a> web apps onto <a href=\"http:\/\/www.heroku.com\/\" target=\"_blank\">Heroku<\/a>.<\/p>\n<p>I realised that I&#8217;ve not mentioned my experiences with coding in Ruby. My motivation to learn Ruby On Rails was triggered by the fact that I was developing a rather large Asp.Net MVC web app in my day job, and <a href=\"http:\/\/www.amazon.co.uk\/gp\/product\/1430234040\/ref=as_li_ss_tl?ie=UTF8&#038;tag=michaokaricom-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=1430234040\" target=\"_blank\">according to one of the books<\/a> on <a href=\"http:\/\/www.michaelokarimia.com\/blog\/2012\/06\/05\/recommend-reading-programming-books-for-c-web-development\/\" title=\"Recommend reading: Programming Books for C# web development\">my reading list<\/a> it was the inspiration for the Microsoft&#8217;s framework.<\/p>\n<p>I&#8217;d returned from a holiday in Russia and I wanted to share the photos with my friends in a novel fashion. Why not create my own website to share them and learn Ruby On Rails in process? As a result, I created a few sites using RoR, <a href=\"http:\/\/publicpics.herokuapp.com\/\" target=\"_blank\">this one being the public clone of my photos website<\/a> The rest of this post covers how I launched these sites.<\/p>\n<p>After a little googling, I decided I would do my Ruby development on a Linux based OS as opposed to Windows, since I would be able to keep up my Linux knowledge. Vim was to be my text editor of choice.<\/p>\n<p>To get a grasp on the Ruby language I started working on the <a href=\"https:\/\/github.com\/michaelokarimia\/ruby_koans\" target=\"_blank\">Ruby Koans exercises<\/a> and once I felt sufficiently competent I moved onto understanding how it weaves into Rails to result in the accomplished and popular web framework. <a href=\"http:\/\/ruby.railstutorial.org\/ruby-on-rails-tutorial-book\" target=\"_blank\">Michael Hartl&#8217;s Tutorial is the perfect place to start<\/a><\/p>\n<p>I dabbled with deploying a Ruby On Rail web app on <a href=\"http:\/\/www.modrails.com\/\" target=\"_blank\">Phusion Passenger<\/a> without much luck, so I then decided to take the simplest route to hosting and go with Heroku. I&#8217;d already decided that<a href=\"http:\/\/www.michaelokarimia.com\/blog\/2010\/05\/10\/my-technology-curriculum\/\" title=\"My Technology Curriculum\" target=\"_blank\"> I would learn Git quite some time ago<\/a>; now would be the time to take the plunge!<\/p>\n<p>Along my path of deploying the web site I went for the option of using a <a href=\"http:\/\/balderapp.com\/\" target=\"_blank\">mature open source photo site called Balder<\/a>. Doing this meant I could get my web site launched in a reasonable time frame, and to also avoid <a href=\"http:\/\/en.wikipedia.org\/wiki\/Reinventing_the_wheel\" target=\"_blank\">reinventing the wheel<\/a><\/p>\n<p>Overall I felt it was a positive learning experience. I started to learn a new language and framework, which allowed me to appreciate MVC.Net and see where Ruby isn&#8217;t so great in comparison. For example, Ruby&#8217;s concept of Active Record may be useful for rapid development, but it <a href=\"http:\/\/www.fluentnhibernate.org\/\" target=\"_blank\">lacks the strengths of Fluent NHibernate<\/a>. Some have <a href=\"http:\/\/www.mehdi-khalili.com\/orm-anti-patterns-part-1-active-record\" target=\"_blank\">argued that Active Record is itself an anti-pattern<\/a>.<\/p>\n<p>I became much more familiar with the Linux Terminal and I&#8217;m happy to see that <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/bb978526.aspx\" target=\"_blank\">Windows Power Shell<\/a> has Windows analogues to Linux commands I&#8217;ve committed to muscle memory. I&#8217;m also a big Git fan and I&#8217;m comfortable using it at the command line.<\/p>\n<p>With my understanding of git <a href=\"https:\/\/github.com\/michaelokarimia\" title=\"My Github page\" target=\"_blank\">I&#8217;ve come to use Github too, and all the great ideas that flow from it<\/a>.<\/p>\n<p>It was a worthwhile endeavour, even just for the insight gained. You can visit the fruits of my labours and see for yourself: <a href=\"http:\/\/publicpics.herokuapp.com\/\" title=\"http:\/\/publicpics.herokuapp.com\/\" target=\"_blank\">http:\/\/publicpics.herokuapp.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous post that I wrote on the topic of deploying web applications on to Azure cloud I compared that to my experience of deploying Ruby on Rails web apps onto Heroku. I realised that I&#8217;ve not mentioned my experiences with coding in Ruby. My motivation to learn Ruby On Rails was triggered by [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,32],"tags":[34,33,22,20],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-cloud","category-ruby-on-rails","tag-git","tag-ruby-on-rails-2","tag-ubuntu","tag-vim"],"_links":{"self":[{"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":16,"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":577,"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/posts\/371\/revisions\/577"}],"wp:attachment":[{"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.michaelokarimia.com\/blog\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}