<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: No Rails for me</title>
	<atom:link href="http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/feed/" rel="self" type="application/rss+xml" />
	<link>http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/</link>
	<description>Pickled ramblings and homemade marmalade</description>
	<lastBuildDate>Sun, 07 Mar 2010 19:13:20 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: janko</title>
		<link>http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/comment-page-1/#comment-6432</link>
		<dc:creator>janko</dc:creator>
		<pubDate>Wed, 13 Feb 2008 12:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/#comment-6432</guid>
		<description>&quot;little lime&quot; = &quot;little time&quot;</description>
		<content:encoded><![CDATA[<p>&#8220;little lime&#8221; = &#8220;little time&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janko</title>
		<link>http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/comment-page-1/#comment-6431</link>
		<dc:creator>janko</dc:creator>
		<pubDate>Wed, 13 Feb 2008 12:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/#comment-6431</guid>
		<description>Hi, Srđan... Thanks for your explanation a LOT. I never say never and know that I don&#039;t know everything so didn&#039;t close any doors to ruby. 

I would like to ask so for some details or object at some of the points you made but I will rather take a little lime and larn some more about few topics of programmign that I don&#039;t yet know that well.

Otherwise I see many interesting things going on with Ruby itself (concurency paradigms for one) so I will surelly be checking the sole ruby again. I was a python programmer for a long time (a while back) and I always considered ruby an python somewhat similar so I didn&#039;t yet bother to pick up ruby. But with RoR and all the fuzz ruby is now progressing into interesting directions so I keep an eye on it .. we will see what will come out..

thanks, 
j.

hm.. meetups.. some day when I have time and stuff :)</description>
		<content:encoded><![CDATA[<p>Hi, Srđan&#8230; Thanks for your explanation a LOT. I never say never and know that I don&#8217;t know everything so didn&#8217;t close any doors to ruby. </p>
<p>I would like to ask so for some details or object at some of the points you made but I will rather take a little lime and larn some more about few topics of programmign that I don&#8217;t yet know that well.</p>
<p>Otherwise I see many interesting things going on with Ruby itself (concurency paradigms for one) so I will surelly be checking the sole ruby again. I was a python programmer for a long time (a while back) and I always considered ruby an python somewhat similar so I didn&#8217;t yet bother to pick up ruby. But with RoR and all the fuzz ruby is now progressing into interesting directions so I keep an eye on it .. we will see what will come out..</p>
<p>thanks,<br />
j.</p>
<p>hm.. meetups.. some day when I have time and stuff <img src='http://itmmetelko.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srđan Prodanović</title>
		<link>http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/comment-page-1/#comment-5905</link>
		<dc:creator>Srđan Prodanović</dc:creator>
		<pubDate>Mon, 04 Feb 2008 01:14:11 +0000</pubDate>
		<guid isPermaLink="false">http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/#comment-5905</guid>
		<description>A piece of code there got filtered because I forgot to escape &lt;

&lt;code&gt;
class CommentsController &lt; ResourceController::Base
	belongs_to :commentable
	actions :new, :create	
	create.wants.html { redirect_to parent_object }
	create.wants.js
end
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>A piece of code there got filtered because I forgot to escape &lt;</p>
<p><code><br />
class CommentsController &lt; ResourceController::Base<br />
	belongs_to :commentable<br />
	actions :new, :create<br />
	create.wants.html { redirect_to parent_object }<br />
	create.wants.js<br />
end<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srđan Prodanović</title>
		<link>http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/comment-page-1/#comment-5904</link>
		<dc:creator>Srđan Prodanović</dc:creator>
		<pubDate>Mon, 04 Feb 2008 01:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://itmmetelko.com/blog/2008/02/03/no-rails-for-me/#comment-5904</guid>
		<description>&lt;em&gt;Why do I have to find the record, change it and store it back? Databases have UPDATE  right?&lt;/em&gt;
The power of ActiveRecord is not just in the object-relational mapping, but in it&#039;s behaviour as a Model. The most powerful relation mapping and validation goes on dynamically in a Ruby object, and that object needs data for it&#039;s initializers and properties. Since you deal with data validation and errors in the model, you never deal with a MySQL error, but an ActiveRecord error, which abstracts the error handling logic to become more loosely coupled to the database server. But in case you have no validations or relations to take care of, you can always do a simple &lt;code&gt;Recipe.update params[:recipe]&lt;/code&gt;. If you really feel like writing vanilla SQL by hand though, you can still do &lt;code&gt;Recipe.connection.execute &quot;UPDATE recipes SET  body = &#039;&quot; + params[:recipe][:body] + &quot;&#039; WHERE id = &quot; + params[:recipe][:id]&lt;/code&gt;. Notice you have no input validation and way more keystrokes the more you try to complicate.
&lt;em&gt; Why use a external language’s API method for creating current date to store in a DB (and think about formats and all sorts of stuff) if DBs have NOW() and other functions for this?&lt;/em&gt;
Occasionally you may want to take in account timezones. The example you pasted is pre 1.0 though, timestamps are managed automatically for a long while now.
&lt;em&gt;Can one action create only one flash notice?&lt;/em&gt;
You can modify the variable flash[:notice] and store whatever you like. You&#039;ll rarely need a notice to last longer than one action, or a several notices per one action. If you ever do, it&#039;s good to consider the design again, and check if you can break an action down to more basic functionality, but you can always use http://software.pmade.com/stickies if necessary.
&lt;em&gt;Why does a method that makes modification to the database (a backend method) handle where user will get redirected after the action??? This is total crap, this method should only update the DB and not have any effect on the frontend, so it can be called from anywhere you need it (admin panel, some ajax call, RPC, frontend..) … I didn’t even bother digging into MVC because I found it too extreme and impractical from what I saw on the surface and my code never does that.&lt;/em&gt;
You seem to have missed the concept of MVC. The method that updates the database can be added to the model, so you call it in a nice abstract way. And controller is the only place you should make database requests from (or at least that&#039;s what you should try to stick with). For instance, you can have a complex transaction defined in your  model, and call it from the controller with a one liner like &lt;code&gt;Store.find_near params[:location]&lt;/code&gt;, where the location parameter can hold streets and cities your geotagged Store model will use to order results by distance.
&lt;em&gt;How can it be that DSL-s (domain specific languages) are oh-so-cool and at the same time ORM’s, Active Records and similar stuff that puts wrappers around them is also oh-so-cool?&lt;/em&gt;
Because simplifying something in a pattern and adding a layer of abstraction is the way software develops to become more powerful than the sum of it&#039;s pieces.
&lt;em&gt;Isn’t Active Record so MS Access 98?&lt;/em&gt;
Hah, as much as Ruby is Microsoft QBasic.
Nobody can force you into anything, but expect praise and encouraging from Ruby enthusiasts like me :-) You have to aggree that when you get to write this much to have a working comments controller, you can make a lot of comment-enabled web apps for sure :-D
&lt;code&gt;
class CommentsController 
If you feel like getting together with Ruby on Rails developers from Slovenia, join us at http://ruby.meetup.com/126/</description>
		<content:encoded><![CDATA[<p><em>Why do I have to find the record, change it and store it back? Databases have UPDATE  right?</em><br />
The power of ActiveRecord is not just in the object-relational mapping, but in it&#8217;s behaviour as a Model. The most powerful relation mapping and validation goes on dynamically in a Ruby object, and that object needs data for it&#8217;s initializers and properties. Since you deal with data validation and errors in the model, you never deal with a MySQL error, but an ActiveRecord error, which abstracts the error handling logic to become more loosely coupled to the database server. But in case you have no validations or relations to take care of, you can always do a simple <code>Recipe.update params[:recipe]</code>. If you really feel like writing vanilla SQL by hand though, you can still do <code>Recipe.connection.execute "UPDATE recipes SET  body = '" + params[:recipe][:body] + "' WHERE id = " + params[:recipe][:id]</code>. Notice you have no input validation and way more keystrokes the more you try to complicate.<br />
<em> Why use a external language’s API method for creating current date to store in a DB (and think about formats and all sorts of stuff) if DBs have NOW() and other functions for this?</em><br />
Occasionally you may want to take in account timezones. The example you pasted is pre 1.0 though, timestamps are managed automatically for a long while now.<br />
<em>Can one action create only one flash notice?</em><br />
You can modify the variable flash[:notice] and store whatever you like. You&#8217;ll rarely need a notice to last longer than one action, or a several notices per one action. If you ever do, it&#8217;s good to consider the design again, and check if you can break an action down to more basic functionality, but you can always use <a href="http://software.pmade.com/stickies" rel="nofollow">http://software.pmade.com/stickies</a> if necessary.<br />
<em>Why does a method that makes modification to the database (a backend method) handle where user will get redirected after the action??? This is total crap, this method should only update the DB and not have any effect on the frontend, so it can be called from anywhere you need it (admin panel, some ajax call, RPC, frontend..) … I didn’t even bother digging into MVC because I found it too extreme and impractical from what I saw on the surface and my code never does that.</em><br />
You seem to have missed the concept of MVC. The method that updates the database can be added to the model, so you call it in a nice abstract way. And controller is the only place you should make database requests from (or at least that&#8217;s what you should try to stick with). For instance, you can have a complex transaction defined in your  model, and call it from the controller with a one liner like <code>Store.find_near params[:location]</code>, where the location parameter can hold streets and cities your geotagged Store model will use to order results by distance.<br />
<em>How can it be that DSL-s (domain specific languages) are oh-so-cool and at the same time ORM’s, Active Records and similar stuff that puts wrappers around them is also oh-so-cool?</em><br />
Because simplifying something in a pattern and adding a layer of abstraction is the way software develops to become more powerful than the sum of it&#8217;s pieces.<br />
<em>Isn’t Active Record so MS Access 98?</em><br />
Hah, as much as Ruby is Microsoft QBasic.<br />
Nobody can force you into anything, but expect praise and encouraging from Ruby enthusiasts like me <img src='http://itmmetelko.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You have to aggree that when you get to write this much to have a working comments controller, you can make a lot of comment-enabled web apps for sure <img src='http://itmmetelko.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /><br />
<code><br />
class CommentsController<br />
If you feel like getting together with Ruby on Rails developers from Slovenia, join us at <a href="http://ruby.meetup.com/126/" rel="nofollow">http://ruby.meetup.com/126/</a></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
