<?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"
	>

<channel>
	<title>sukria.net &#187; Ruby on Rails</title>
	<atom:link href="http://www.sukria.net/en/archives/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sukria.net/en</link>
	<description>Being a debian geek, that's a way of life!</description>
	<pubDate>Wed, 10 Dec 2008 10:01:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>New release and plans for Coat::Persistent</title>
		<link>http://www.sukria.net/en/archives/2008/02/22/new-release-and-plans-for-coatpersistent/</link>
		<comments>http://www.sukria.net/en/archives/2008/02/22/new-release-and-plans-for-coatpersistent/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 22:19:39 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
		
		<category><![CDATA[Ruby on Rails]]></category>

		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.sukria.net/en/archives/2008/02/22/new-release-and-plans-for-coatpersistent/</guid>
		<description><![CDATA[I&#8217;ve uploaded a new developer release of Coat::Persistent to the CPAN. In this version, the modules Cache::FastMmap and DBD::CSV are made optional (they were mandatory dependencies until then). Moreover, Coat::Persistent now uses DBIx::Sequence for primary keys generation.
After thinking a lot to the future of that tiny ORM (which is actually very small, unfinished and questionable) [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded <a href="http://search.cpan.org/dist/Coat-Persistent/">a new developer release of Coat::Persistent</a> to the CPAN. In this version, the modules Cache::FastMmap and DBD::CSV are made optional (they were mandatory dependencies until then). Moreover, Coat::Persistent now uses DBIx::Sequence for primary keys generation.</p>
<p>After thinking a lot to the future of that tiny ORM (which is actually very small, unfinished and questionable) I came to a conclusion: Class:DBIx is in the place and just rules. That&#8217;s an amazing ORM and is really a great module to use. -<em>I&#8217;m aware what follows in that blog entry may sound contradictory</em>- I work daily with Ruby on Rails, but I just love Perl and the goodness of CPAN, I love writing Perl code, I love writing Perl modules ; I also find Rails&#8217;ORM amaizingly well designed, easy-to-use and scalable. I like the choices made, well, I like how you can <em>feel</em> your database through that object-mapping abstraction layer that ActiveRecord provides.</p>
<p>My point here is not to discuss Class::DBIx, but rather to underline how Rails&#8217; ActiveRecord is something worth looking at, and something - I think - Perl lacks.</p>
<p>I may be wrong, but I feel like some Perl developers around could agree, I hope. I also hope I won&#8217;t trigger the anger of someone involved with Class::DBIx, which, let me say it again, is a great module.</p>
<p>My plan here is to take the <a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html">ActiveRecord API</a>, and try to upgrade Coat::Persistent, piece by piece, in order to get as close as possible to it. That&#8217;s an exciting challenge, and could give me enough intellectual food for the next months.</p>
<p>I may be targetting something too large for me, I may be taking the wrong path, but I feel like following the spirit of Perl taking that direction : There&#8217;s more than one way to do it, isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/en/archives/2008/02/22/new-release-and-plans-for-coatpersistent/feed/</wfw:commentRss>
		</item>
		<item>
		<title>link_to_draggable</title>
		<link>http://www.sukria.net/en/archives/2007/03/20/link_to_draggable/</link>
		<comments>http://www.sukria.net/en/archives/2007/03/20/link_to_draggable/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 11:03:44 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
		
		<category><![CDATA[Ruby on Rails]]></category>

		<category><![CDATA[scriptaculous]]></category>

		<guid isPermaLink="false">http://www.sukria.net/en/archives/2007/03/20/link_to_draggable/</guid>
		<description><![CDATA[It&#8217;s been a couple of months since I&#8217;ve started playing with Rails. I must say (fear the buzz) that it just kicks your ass.
One of the stuff I really like in Rails is the scriptaculous library integration: you have a couple of easy-to-use functions for generating JavaScript voodoo. One of them being draggable_element() which allows [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a couple of months since I&#8217;ve started playing with <a href="http://www.rubyonrails.org/">Rails</a>. I must say (fear the buzz) that it just kicks your ass.</p>
<p>One of the stuff I really like in Rails is the <a href="http://script.aculo.us/">scriptaculous</a> library integration: you have a couple of easy-to-use functions for generating JavaScript voodoo. One of them being draggable_element() which allows you to drag a random object of the DOM and drop it somewhere.</p>
<p>I&#8217;m using that function in one of my Rails project and I discovered a bug that occurs with last versions of Mozilla Firefox (does not seem to affect IE). When using draggable_element() on a link item a conflict occurs when dropping the link on the page, making the browser to follow the link. It looks like something went wrong with the overload of the &#8220;onMouseDown&#8221; event.</p>
<p>As I just had to use <a href="http://wiki.rubyonrails.org/rails/pages/ActionView::Helpers::ScriptaculousHelper.draggable_element">draggable_element()</a> on link items and as I found nothing about that issue after Googling a bit, I started writing a fix which led to a new helper called link_to_draggable().</p>
<p>The idea behind the fix is simple (and of course a bit crappy-but-working): a flag is set to tell if the link should be followed or not. That flag will be updated accordingly when a regular click is performed, and when a drag starts.</p>
<p><a href="http://www.sukria.net/code/link_to_draggable.html">Here is how to use it.</a></p>
<p>The first two args are the same as the ones used by link_to(): the name and url of the link. The third argument is a hashtable of options to pass to the link_to() call. The last argument is a hashtable of options to pass to draggable_element().</p>
<p>Now <a href="http://www.sukria.net/code/link_to_draggable_helper.html">here is the code</a>, if you like to use that helper thingy in your Rails app.</p>
<p>Of course that could be done better, the best thing to do would be to fix draggable_element() itself, if you ask me.<br />
Anyway I had to fix that bug, and in the meantime, that solution just does the job for me, maybe it does also for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/en/archives/2007/03/20/link_to_draggable/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
