<?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>Admoo Labs &#187; Gerald Abrencillo</title>
	<atom:link href="http://blog.admoolabs.com/author/gerald/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.admoolabs.com</link>
	<description>Bringing fun back to the web.</description>
	<lastBuildDate>Sun, 07 Mar 2010 13:45:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sortable Tables</title>
		<link>http://blog.admoolabs.com/sortable-tables/</link>
		<comments>http://blog.admoolabs.com/sortable-tables/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 04:46:44 +0000</pubDate>
		<dc:creator>Gerald Abrencillo</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=87</guid>
		<description><![CDATA[Rails has a helper function called sortable_element that generates ajax code to allow you to sort lists by dragging and dropping elements. The function defaults to handle lists and if you want to sort tables you should take note of the :tag option.
&#38;lt;%= sortable_element 'my_list',
:url =&#38;gt; { :action =&#38;gt; "order" },     [...]]]></description>
			<content:encoded><![CDATA[<p>Rails has a helper function called sortable_element that generates ajax code to allow you to sort lists by dragging and dropping elements. The function defaults to handle lists and if you want to sort tables you should take note of the :tag option.</p>
<pre><code>&amp;lt;%= sortable_element 'my_list',</code></pre>
<pre style="padding-left:30px;"><code>:url =&amp;gt; { :action =&amp;gt; "order" },       </code></pre>
<pre style="padding-left:30px;"><code>:tag =&amp;gt; 'tr' %&amp;gt;</code></pre>
<p>This should allow you to sort tables and hopefully save you from a big headache.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/sortable-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alphabar on Rails</title>
		<link>http://blog.admoolabs.com/alphabar-on-rails/</link>
		<comments>http://blog.admoolabs.com/alphabar-on-rails/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 02:26:16 +0000</pubDate>
		<dc:creator>Gerald Abrencillo</dc:creator>
				<category><![CDATA[Bugs and Fixes]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[alphabar]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=15</guid>
		<description><![CDATA[I am working on this little project right now using Ruby on Rails and I ran into some trouble with the alphabar plugin. First, alphabar uses the with_scope method which, since Rails 2.0 I believe, has been protected, giving me some errors since I froze my Rails version. I was able to overcome this obstacle [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on this little project right now using Ruby on Rails and I ran into some trouble with the alphabar plugin. First, alphabar uses the with_scope method which, since Rails 2.0 I believe, has been protected, giving me some errors since I froze my Rails version. I was able to overcome this obstacle by using the send method instead. Just change the last part of the find method of the plugin from:</p>
<pre><code>model.with_scope({:find =&amp;gt; {:conditions =&amp;gt; conditions}})
{model.find :all}</code></pre>
<p>to:</p>
<pre><code>model.send(:with_scope, {:find =&amp;gt; {:conditions =&amp;gt; conditions}})
{model.find :all}</code></pre>
<p>After I finally got that to work the plugin was very useful, although the alphabar was limited to letters and blank which is useful if you don&#8217;t need numbers. To accomodate numbers just add this to the alphabar helper:</p>
<pre><code>('0'..'9').to_a.each do |i|
slots &amp;lt;&amp;lt; i
end</code></pre>
<p>Theoretically it should work for any character but I haven&#8217;t tried it yet.</p>
<p>So there you have it. Hoepfully somebody having trouble with this plugin will find this post useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/alphabar-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nl2br in RoR</title>
		<link>http://blog.admoolabs.com/nl2br-in-ror/</link>
		<comments>http://blog.admoolabs.com/nl2br-in-ror/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 04:40:48 +0000</pubDate>
		<dc:creator>Gerald Abrencillo</dc:creator>
				<category><![CDATA[Bugs and Fixes]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[nl2br]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=10</guid>
		<description><![CDATA[I recently found out that line breaks are not recognized when displaying a large block of text on the view (e.g. a post body). In PHP this was handled by the nl2br method but I had no luck finding a similar function in RoR. So I did what any sane person would do, create one [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found out that line breaks are not recognized when displaying a large block of text on the view (e.g. a post body). In PHP this was handled by the nl2br method but I had no luck finding a similar function in RoR. So I did what any sane person would do, create one myself. I placed this method in our model to format a particular field but it seems a better choice to put it in a helper.</p>
<blockquote><p> def nl2br(text)</p>
<p>return  text.gsub(/\n/, &#8216;&lt;br/&gt;&#8217;)</p>
<p>end</p></blockquote>
<p>And there you have it, your very own nl2br method. Either you just found something really useful or I just wasted 2 minutes of your time. If anyone has a better solution or if I missed a function for this let us know by dropping a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/nl2br-in-ror/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
