<?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>Icebergist &#187; Ruby and Rails</title>
	<atom:link href="http://icebergist.com/category/ruby-and-rails/feed" rel="self" type="application/rss+xml" />
	<link>http://icebergist.com</link>
	<description>Exploring hidden depths of web apps business</description>
	<lastBuildDate>Mon, 29 Mar 2010 13:14:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails 3 reading list</title>
		<link>http://icebergist.com/posts/rails-3-reading-list</link>
		<comments>http://icebergist.com/posts/rails-3-reading-list#comments</comments>
		<pubDate>Mon, 29 Mar 2010 13:14:23 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=38</guid>
		<description><![CDATA[I&#8217;ve been planning to catchup with all the new Rails 3 stuff. To get me started I&#8217;ve compiled a small Rails 3 related reading list.

Ruby on Rails 3.0 Release Notes
Active Record Query Interface 3.0
The Skinny on Scopes (Formerly named_scope)
Rails 3 Beautiful Code
Railscasts &#8211; rails-3.0 episodes
jQuery with Rails 3
The Rails Module (in Rails 3)

Once I&#8217;m done [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been planning to catchup with all the new Rails 3 stuff. To get me started I&#8217;ve compiled a small Rails 3 related reading list.</p>
<ol>
<li><a href="http://guides.rails.info/3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></li>
<li><a href="http://m.onkey.org/2010/1/22/active-record-query-interface">Active Record Query Interface 3.0</a></li>
<li><a href="http://edgerails.info/articles/what-s-new-in-edge-rails/2010/02/23/the-skinny-on-scopes-formerly-named-scope/">The Skinny on Scopes (Formerly named_scope)</a></li>
<li><a href="http://blog.envylabs.com/2010/02/rails-3-beautiful-code/">Rails 3 Beautiful Code</a></li>
<li><a href="http://railscasts.com/tags/27">Railscasts &#8211; rails-3.0 episodes</a></li>
<li><a href="http://joshhuckabee.com/jquery-rails-3">jQuery with Rails 3</a></li>
<li><a href="http://litanyagainstfear.com/blog/2010/02/03/the-rails-module/">The Rails Module (in Rails 3)</a></li>
</ol>
<p>Once I&#8217;m done with it I plan to get even more from:</p>
<ul>
<li><a href="http://edgerails.info/articles/what-s-new-in-edge-rails/2010/02/10/rails-3-resources/">Rails 3 Resources</a></li>
<li><a href="http://www.rubyinside.com/rails-3-0-beta-links-2966.html">Rails 3.0 Beta: 36 Links and Resources To Get You Going</a></li>
</ul>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Rails%203%20reading%20list&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Frails-3-reading-list"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Rails 3 reading list";
		a2a_linkurl="http://icebergist.com/posts/rails-3-reading-list";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/rails-3-reading-list/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expected x.rb to define X (LoadError)</title>
		<link>http://icebergist.com/posts/expected-xrb-to-define-x-loaderror</link>
		<comments>http://icebergist.com/posts/expected-xrb-to-define-x-loaderror#comments</comments>
		<pubDate>Wed, 15 Apr 2009 16:00:56 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=33</guid>
		<description><![CDATA[I have been working on extending Rails&#8217; I18n Simple backend to make it work with Serbian grammar (post on that will follow soon), but I kept getting an error:
Expected ./lib/serbian_simple.rb to define SerbianSimple (LoadError)
I&#8217;ve just spent an hour trying to figure out why this keeps happening and I found that there&#8217;s a lot of people [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on extending Rails&#8217; I18n Simple backend to make it work with Serbian grammar (post on that will follow soon), but I kept getting an error:</p>
<p><code>Expected ./lib/serbian_simple.rb to define SerbianSimple (LoadError)</code></p>
<p>I&#8217;ve just spent an hour trying to figure out why this keeps happening and I found that there&#8217;s a lot of people with similar problem.</p>
<p>It seems that the problem appears when Rails tries to autoload files. In my case there was a simple solution &#8211; I just added require &#8217;serbian_simple.rb&#8217; in environment.rb to manually load the file.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Expected%20x.rb%20to%20define%20X%20%28LoadError%29&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fexpected-xrb-to-define-x-loaderror"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Expected x.rb to define X (LoadError)";
		a2a_linkurl="http://icebergist.com/posts/expected-xrb-to-define-x-loaderror";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/expected-xrb-to-define-x-loaderror/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RESTful admin namespaced controller using scaffolding</title>
		<link>http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding</link>
		<comments>http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding#comments</comments>
		<pubDate>Wed, 17 Sep 2008 20:58:56 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scaffold]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=14</guid>
		<description><![CDATA[Most of my clients prefer to have a separate admin section. In turn, I like to have separate controllers for admin section and front-end in my Rails app. This is not as straightforward as it might seem, especially if you like to use scaffolding for admin controller.
The goal is to get 2 separate RESTful controllers, [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my clients prefer to have a separate admin section. In turn, I like to have separate controllers for admin section and front-end in my Rails app. This is not as straightforward as it might seem, especially if you like to use scaffolding for admin controller.</p>
<p>The goal is to get 2 separate RESTful controllers, admin &amp; front-end controller, one model and for admin pages to have scaffolding.</p>
<p>Here is the easiest way I found so far to accomplish this. This example generates categories model and controllers for it.</p>
<p><code>./script/generate controller admin/categories<br />
./script/generate scaffold category name:string</code></p>
<p>This will generate an empty controller in admin namespace and a scaffolded resource for front-end controller.</p>
<p>Now we have everything generated we just need to make it work with admin controller and not with front-end.</p>
<ul>
<li>move all templates from app/views/categories to app/views/<strong>admin</strong>/categories</li>
<li>copy all functions from categories_controller.rb to admin/categories_controller.rb</li>
<li>add namespace for admin controller in routes.rb:<code>map.namespace :admin do |admin|<br />
admin.resources :categories<br />
end</code></li>
<li>in admin/categories_controller.rb replace in 3 places redirect_to calls to work with admin namespace. It will have something like redirect_to(@category), but to work with namespace it needs to have redirect_to([:admin, @category])</li>
<li>make similar changes in all templates, i.e. make it work within an admin namespace. You need to make following changes:
<ul>
<li>form_for(@category) =&gt; <strong>form_for([:admin, @category])</strong></li>
<li>&lt;%= link_to &#8216;Show&#8217;, @category %&gt; =&gt; <strong>&lt;%= link_to &#8216;Show&#8217;, [:admin, @category] %&gt;</strong></li>
<li>categories_path =&gt; <strong>admin_categories_path</strong></li>
<li>edit_category_path(@category) =&gt; <strong>edit_admin_category_path(@category)</strong></li>
<li>new_category_path =&gt; <strong>new_admin_category_path</strong></li>
</ul>
</li>
</ul>
<p>That&#8217;s it. Now you&#8217;ll have /admin/categories for all administrative tasks and you have a free controller for front-end actions.</p>
<p>You might wonder why not just generate scaffold for admin/categories&#8230; The reason is that you&#8217;ll also get a model that is namespaced in admin (i.e. model would be Admin::Category). Scaffolded views also wouldn&#8217;t work as it seems that generator doesn&#8217;t take into account the fact that you are using a namespace.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=RESTful%20admin%20namespaced%20controller%20using%20scaffolding&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Frestful-admin-namespaced-controller-using-scaffolding"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="RESTful admin namespaced controller using scaffolding";
		a2a_linkurl="http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Mosso hosting cloud</title>
		<link>http://icebergist.com/posts/mosso-hosting-cloud</link>
		<comments>http://icebergist.com/posts/mosso-hosting-cloud#comments</comments>
		<pubDate>Wed, 17 Sep 2008 10:44:33 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=13</guid>
		<description><![CDATA[Mosso&#8217;s hosting cloud at $100 / month seems like a good solution to get a scalable server. However one thing bugs me, actually two things&#8230;
First one: they offer FTP only access. Meaning you cannot deploy sites directly from code repositories (i.e. git or svn). That sucks.
Second thing that bugs me: for $100 you get quite [...]]]></description>
			<content:encoded><![CDATA[<p><a class="external" href="http://www.mosso.com/">Mosso&#8217;s hosting cloud</a> at $100 / month seems like a good solution to get a scalable server. However one thing bugs me, actually two things&#8230;</p>
<p>First one: they offer <strong>FTP only access</strong>. Meaning you cannot deploy sites directly from code repositories (i.e. git or svn). That sucks.</p>
<p>Second thing that bugs me: for $100 you get quite a lot of computing power which can be used to run multiple sites &#8211; but <strong>you are only allowed to have one Rails app running</strong>. Only one. If you want additional Rails apps (for example to have a test server) you need to pay an extra fee.</p>
<p>I know it&#8217;s cloud computing and that you have to be able to run it with any additional configuration (that&#8217;s why I think it&#8217;s ok that you have to freeze your gems in Rails apps, because you cannot install any gems yourself)&#8230; but not being able to checkout my code from repository and having to upload the whole app each time you make changes <strong>is really annoying</strong>.</p>
<p>In their defense, the support guy said that they are working on it, but he could give me an ETA when they&#8217;ll allow something like that.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Mosso%20hosting%20cloud&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fmosso-hosting-cloud"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Mosso hosting cloud";
		a2a_linkurl="http://icebergist.com/posts/mosso-hosting-cloud";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/mosso-hosting-cloud/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Collection partial variable naming &#8211; new in edge rails</title>
		<link>http://icebergist.com/posts/collection-partial-variable-naming</link>
		<comments>http://icebergist.com/posts/collection-partial-variable-naming#comments</comments>
		<pubDate>Mon, 07 Jul 2008 21:41:41 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=9</guid>
		<description><![CDATA[One thing that always annoyed me when rendering collection partials is that a local var in partial is named same as a partial template name. So, to go around this I always created another local variable in partial and gave it a more meaningful name.
No longer&#8230; As the Ryan says from now on in the [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that always annoyed me when rendering collection partials is that a local var in partial is named same as a partial template name. So, to go around this I always created another local variable in partial and gave it a more meaningful name.</p>
<p>No longer&#8230; As the <a title="What's New in Edge Rails: Collection Partial Variable Naming " href="http://ryandaigle.com/articles/2008/7/7/what-s-new-in-edge-rails-collection-partial-variable-naming">Ryan says</a> from now on in the Edge Rails you can specify the name of the local variable in which each collection element will be exposed within a partial. You will can do this:</p>
<pre>render :partial =&gt; 'employees', :collection =&gt; @workers, :as =&gt; :person</pre>
<p>It&#8217;s a simple thing, but it&#8217;s just one of the things that bugged me. I am glad it&#8217;s gone now.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Collection%20partial%20variable%20naming%20%E2%80%93%20new%20in%20edge%20rails&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fcollection-partial-variable-naming"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Collection partial variable naming – new in edge rails";
		a2a_linkurl="http://icebergist.com/posts/collection-partial-variable-naming";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/collection-partial-variable-naming/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SproutCore &#8211; a javascript framework</title>
		<link>http://icebergist.com/posts/sproutcore-javascript-framework</link>
		<comments>http://icebergist.com/posts/sproutcore-javascript-framework#comments</comments>
		<pubDate>Thu, 03 Jul 2008 21:54:11 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=4</guid>
		<description><![CDATA[SproutCore is a javascript framework which tries to enable developers to build web apps that look and act more like a desktop apps.
It steps away from a classic web app model by moving a lot of app into the browser itself, which then interacts with server via AJAX. As it says on the SproutCore site:
After [...]]]></description>
			<content:encoded><![CDATA[<p><a title="SproutCore - Javascript Framework" href="http://www.sproutcore.com">SproutCore</a> is a javascript framework which tries to enable developers to build web apps that look and act more like a desktop apps.</p>
<p>It steps away from a classic web app model by moving a lot of app into the browser itself, which then interacts with server via AJAX. As it says on the <a title="About SproutCore" href="http://www.sproutcore.com/about/">SproutCore site</a>:</p>
<blockquote><p>After lots of testing, we have found that the most efficient way to server a SproutCore application is as a …. static web page!</p></blockquote>
<p>This means that a &#8220;simple&#8221; static HTML page (which is easily served by Apache) makes browser do most of the work (i.e. server doesn&#8217;t have to generate the pages) which frees up server to respond only to AJAX initiated requests.</p>
<p><a title="SproutCore - Javascript Framework written in Ruby" href="http://www.sproutcore.com">SproutCore</a> is written in Ruby, but once you build the app it will generate a set of HTML, JS and CSS files, so you don&#8217;t need to know Ruby in order to use it. As the site says:</p>
<blockquote><p>The code you write with SproutCore will resemble a desktop app written in Cocoa more than it will a web application written in Rails.</p></blockquote>
<p><img class="alignright size-full wp-image-6" title="SproutCore Photos Demo" src="http://icebergist.com/wp-content/uploads/2008/07/sprout-photos-demo.jpg" alt="SproutCore Photos Demo Screenshot" width="500" height="236" />Another great thing about SproutCore is that it can be hooked up with any backend as long as it can communicate with it using HTTP. It can be anything: Rails, PHP, Perl, Java, ASP&#8230;</p>
<p>Actions speak louder than words, so take a look at the SproutCore demos which shows you exactly what it&#8217;s all about.</p>
<ul>
<li><a title="SproutCore demo photo gallery" href="http://www.sproutcore.com/static/photos/">SproutCore based photo gallery</a> &#8211; iPhoto anyone? <img src='http://icebergist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><a title="SproutCore demo sample controls" href="http://www.sproutcore.com/static/sample_controls/">SproutCore sample controls</a> &#8211; demonstrates what kind of controls are already available in SproutCore.</li>
</ul>
<p>In next few days I will try to build a sample application powered by SproutCore and Rails to see how it goes. I will post my impressions here. After all if it&#8217;s something Apple used for Mobile.me &#8211; well, it can&#8217;t be that bad. <img src='http://icebergist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=SproutCore%20%E2%80%93%20a%20javascript%20framework&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fsproutcore-javascript-framework"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="SproutCore – a javascript framework";
		a2a_linkurl="http://icebergist.com/posts/sproutcore-javascript-framework";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/sproutcore-javascript-framework/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
