<?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>grzegorz brzezinka.eu</title>
	<atom:link href="http://blog.brzezinka.eu/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.brzezinka.eu</link>
	<description>Be curious. Laugh a lot.</description>
	<lastBuildDate>Mon, 25 Jul 2011 15:35:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux: how to renew DHCP IP address?</title>
		<link>http://blog.brzezinka.eu/linux/linux-how-to-renew-dhcp-ip-address?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-how-to-renew-dhcp-ip-address</link>
		<comments>http://blog.brzezinka.eu/linux/linux-how-to-renew-dhcp-ip-address#comments</comments>
		<pubDate>Mon, 25 Jul 2011 15:34:30 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=217</guid>
		<description><![CDATA[I have just shown a Turnkey Linux Rails (VirtualBox edition) to my RoR developer friend. He really enjoyed using it, however after a few days he mentioned that he had a problem &#8211; every time he moved his laptop to a different network, he needed to restart Linux in orded to detect the proper IP [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I have just shown a <a href="http://www.turnkeylinux.org/updates/rails/new-turnkey-rails-version-111" target="_blank">Turnkey Linux Rails</a> (VirtualBox edition) to my RoR developer friend. He really enjoyed using it, however after a few days he mentioned that he had a problem &#8211; every time he moved his laptop to a different network, he needed to restart Linux in orded to detect the proper IP through bridged network card connection. This is a distinct loss of time!</p>
<p>There is a simple command to renew (restart, or rather reflush) the ethernet connection, that will result in the renewing of DHPC IP. Assuming your network connection is <em>eth0</em> (you can check it with <em>ifconfig</em> command), just type:</p>
<pre>ifdown eth0
ifup eth0</pre>
<p>And that&#8217;s all! The new IP would be printed in the output of the last command.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/linux/linux-how-to-renew-dhcp-ip-address/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Full page background image in Prawn PDF in Rails3</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/rails3/full-page-background-image-in-prawn-pdf-in-rails3?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=full-page-background-image-in-prawn-pdf-in-rails3</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/rails3/full-page-background-image-in-prawn-pdf-in-rails3#comments</comments>
		<pubDate>Sun, 24 Jul 2011 22:05:58 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Rails3]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[prawn]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=212</guid>
		<description><![CDATA[Recently I have worked on project that needed a pdf form to be filled with data gathered in Rails3 app db. As I have decided to use PRAWN as a PDF generator (with prawn_rails gem &#8211; I can really recommend, works with Rails3), I had to choose between recreating the form or just filling in [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Recently I have worked on project that needed a pdf form to be filled with data gathered in Rails3 app db.</p>
<p>As I have decided to use <a href="http://prawn.majesticseacreature.com" target="_blank">PRAWN</a> as a PDF generator (with <a href="https://github.com/Volundr/prawn-rails" target="_blank">prawn_rails</a> gem &#8211; I can really recommend, works with Rails3), I had to choose between recreating the form or just filling in the form that was ready. As time=money, I decided to go for the second possibility.</p>
<p>1. I converted the pdf form to JPG (300 dpi resolution, no compression).</p>
<p>2. I needed A4 page size, so I also need to scale my image. In my <em>example_document.pdf.prawn</em>, I should put:</p>
<pre class="brush: ruby; title: ; notranslate">
bg = &quot;#{RAILS_ROOT}/public/pdf/pdf_bg.jpg&quot;

prawn_document (
    :filename=&gt;'foo.pdf',
    :page_size=&gt; &quot;A4&quot;,
    :margin =&gt; 0) do |pdf|
      pdf.image bg,
        :at  =&gt; [0, Prawn::Document::PageGeometry::SIZES[&quot;A4&quot;][1]],
        :fit =&gt; Prawn::Document::PageGeometry::SIZES[&quot;A4&quot;]
  pdf.text &quot;This is pdf with background image ready to fill in&quot;
end
</pre>
<p>The code above imports the image and positions it in the right left corner (<strong>remember! </strong>bounding box in pdf has its origin [0,0] in BOTTOM LEFT corner of the page). The size of A4 is set as constant by PRAWN (nice of them, isn&#8217;t it?). You can access it by <em>Prawn::Document::PageGeometry::SIZES </em>array. The full list of available page sizes you can find in PRAWN source code at <a href="https://github.com/sandal/prawn/blob/master/lib/prawn/document/page_geometry.rb">https://github.com/sandal/prawn/blob/master/lib/prawn/document/page_geometry.rb</a>.</p>
<p>3. Now one has to play around a little bit in order to position the data obtained from db in right positions.</p>
<p>Good luck!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/rails3/full-page-background-image-in-prawn-pdf-in-rails3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Github error &#8211; fatal: Unable to look up github.com (port 9418) (Name or service not known)</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/rails3/github-error-fatal-unable-to-look-up-github-com-port-9418-name-or-service-not-known?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=github-error-fatal-unable-to-look-up-github-com-port-9418-name-or-service-not-known</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/rails3/github-error-fatal-unable-to-look-up-github-com-port-9418-name-or-service-not-known#comments</comments>
		<pubDate>Sun, 12 Jun 2011 19:08:33 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Rails3]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=205</guid>
		<description><![CDATA[I was trying to add a gem to a Rails3 app gemfile directing it to a git repo by: While bundle install, I got the error message: I tried git clone -q git://github.com/gituser/example.git or rails plugin install git://github.com/gituser/example.git, still I got the same error message. It seems that Github has recently updated DNS and the changes [...]


Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows' rel='bookmark' title='PIK: Multiple Ruby versions for Windows'>PIK: Multiple Ruby versions for Windows</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/rubygems-warningerror-gemspecification-default_executable-is-deprecated-with-no-replacement-it-will-be-removed-on-or-after-2011-10-01' rel='bookmark' title='RubyGems warning/error: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.'>RubyGems warning/error: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<ol>
<li>I was trying to add a gem to a Rails3 app gemfile directing it to a git repo by:</li>
</ol>
<pre class="brush: plain; title: ; notranslate">gem 'example', :git =&gt; &quot;git://github.com/gituser/example.git&quot;</pre>
<p>While <em>bundle install</em>, I got the error message:</p>
<pre class="brush: plain; title: ; notranslate">fatal: Unable to look up github.com (port 9418) (Name or service not known)</pre>
<p>I tried <em>git clone -q git://github.com/gituser/example.git </em>or <em>rails plugin install <em>git://github.com/gituser/example.git, </em></em>still I got the same error message. It seems that Github has recently updated DNS and the changes haven&#8217;t propagated yet. You can use a workaround:</p>
<ol>
<li>Run <em>ping github.com </em> and read the current IP</li>
<li>Go to <em>/etc/hosts </em> on your Rails server (assuming its Linux) and add the following line:
<pre class="brush: plain; title: ; notranslate">
207.97.227.239 github.com wiki.github.com gist.github.com assets0.github.com assets1.github.com assets2.github.com assets3.github.com
</pre>
<p>where instead of <em>207.97.227.239</em> type it the current Github IP</li>
</ol>
<p>It is suggested to remove this line once the DNS is up and working again.</p>
<h6><em><a href="http://www.question-defense.com/2009/03/25/fatal-unable-to-look-up-githubcom-port-9418-name-or-service-not-known">Source</a></em></h6>


<p>Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows' rel='bookmark' title='PIK: Multiple Ruby versions for Windows'>PIK: Multiple Ruby versions for Windows</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/rubygems-warningerror-gemspecification-default_executable-is-deprecated-with-no-replacement-it-will-be-removed-on-or-after-2011-10-01' rel='bookmark' title='RubyGems warning/error: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.'>RubyGems warning/error: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/rails3/github-error-fatal-unable-to-look-up-github-com-port-9418-name-or-service-not-known/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyGems warning/error: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/ruby/rubygems-warningerror-gemspecification-default_executable-is-deprecated-with-no-replacement-it-will-be-removed-on-or-after-2011-10-01?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rubygems-warningerror-gemspecification-default_executable-is-deprecated-with-no-replacement-it-will-be-removed-on-or-after-2011-10-01</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/ruby/rubygems-warningerror-gemspecification-default_executable-is-deprecated-with-no-replacement-it-will-be-removed-on-or-after-2011-10-01#comments</comments>
		<pubDate>Wed, 18 May 2011 01:31:47 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Rails3]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=200</guid>
		<description><![CDATA[After recent update of RubyGems (to 1.8), while running for example bundle install, the user will see a bunch of warnings, like: This is connected with the recent policy of RubyGems team &#8211; read the official statement. They have deprecated 22+ methods! It will take some time for Gem authors to update&#8230; Before then, you [...]


Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ror-railroad-plugin-with-rails-2-3-5-on-windows-error' rel='bookmark' title='RoR: Railroad plugin with Rails 2.3.5 on Windows error'>RoR: Railroad plugin with Rails 2.3.5 on Windows error</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/rails3/github-error-fatal-unable-to-look-up-github-com-port-9418-name-or-service-not-known' rel='bookmark' title='Github error &#8211; fatal: Unable to look up github.com (port 9418) (Name or service not known)'>Github error &#8211; fatal: Unable to look up github.com (port 9418) (Name or service not known)</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows' rel='bookmark' title='PIK: Multiple Ruby versions for Windows'>PIK: Multiple Ruby versions for Windows</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After recent update of RubyGems (to 1.8), while running for example <em>bundle install</em>, the user will see a bunch of warnings, like:</p>
<pre class="brush: plain; title: ; notranslate">
NOTE: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.
</pre>
<p>This is connected with the recent policy of RubyGems team &#8211; <a href="http://blog.zenspider.com/2011/05/rubygems-18-is-coming.html" target="_blank">read the official statement</a>.</p>
<p>They have deprecated 22+ methods! It will take some time for Gem authors to update&#8230; Before then, you may run:</p>
<pre class="brush: plain; title: ; notranslate">
gem pristine --all --no-extensions
</pre>
<p>to get most recent and thus some of the warrnings gone&#8230;</p>


<p>Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ror-railroad-plugin-with-rails-2-3-5-on-windows-error' rel='bookmark' title='RoR: Railroad plugin with Rails 2.3.5 on Windows error'>RoR: Railroad plugin with Rails 2.3.5 on Windows error</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/rails3/github-error-fatal-unable-to-look-up-github-com-port-9418-name-or-service-not-known' rel='bookmark' title='Github error &#8211; fatal: Unable to look up github.com (port 9418) (Name or service not known)'>Github error &#8211; fatal: Unable to look up github.com (port 9418) (Name or service not known)</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows' rel='bookmark' title='PIK: Multiple Ruby versions for Windows'>PIK: Multiple Ruby versions for Windows</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/ruby/rubygems-warningerror-gemspecification-default_executable-is-deprecated-with-no-replacement-it-will-be-removed-on-or-after-2011-10-01/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PIK: Multiple Ruby versions for Windows</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pik-multiple-ruby-versions-for-windows</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows#comments</comments>
		<pubDate>Sun, 27 Mar 2011 23:44:43 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Rails3]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=198</guid>
		<description><![CDATA[Since Rails3 is quite popular right now, many programmers move their projects to this version. So did I However, because of some major bugs in Ruby 1.8.7, Rails3 needs Ruby &#62;=1.9.1. The problem is that I still have to maintain some Rails 2.3.5 projects&#8230; There is a solution: Ruby Version Manager (RVM)&#8230; but not for [...]


Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ror-plugin-install-from-git-repository-in-windows' rel='bookmark' title='RoR: plugin install from GIT repository in Windows'>RoR: plugin install from GIT repository in Windows</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ror-railroad-plugin-with-rails-2-3-5-on-windows-error' rel='bookmark' title='RoR: Railroad plugin with Rails 2.3.5 on Windows error'>RoR: Railroad plugin with Rails 2.3.5 on Windows error</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails' rel='bookmark' title='Alternative strings&#8217;s delimiter for Ruby (on Rails)'>Alternative strings&#8217;s delimiter for Ruby (on Rails)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Since Rails3 is quite popular right now, many programmers move their projects to this version. So did I <img src='http://blog.brzezinka.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  However, because of some major bugs in Ruby 1.8.7, Rails3 needs Ruby &gt;=1.9.1. The problem is that I still have to maintain some Rails 2.3.5 projects&#8230;</p>
<p>There is a solution: Ruby Version Manager (RVM)&#8230; but not for windows <img src='http://blog.brzezinka.eu/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' />  For the latter, you should use PIK gem <a href="https://github.com/vertiginous/pik">https://github.com/vertiginous/pik</a>. The installation is pretty easy, just follow the tutorial at github repo step by step.</p>
<h3>PROBLEM</h3>
<p>So install PIK, add all ruby versions you want to, use the one you need. But well, life is not that easy&#8230; Supposing you&#8217;ve got some more complicated gem dependencies in your gemfile, when you try to run:</p>
<pre class="brush: ruby; title: ; notranslate">
rake db:migrate
</pre>
<p>you will probably see the message like below:</p>
<pre class="brush: plain; title: ; notranslate">
There was an error. Error - can't dup NilClass /gemname/
</pre>
<p>or, in case you use sqlite3:</p>
<pre class="brush: plain; title: ; notranslate">
Unknown method sqlite3_backup_finish in sqlite3.dll.
</pre>
<h3>SOLUTION</h3>
<p>1. Set <em>gem_home</em> for the choosen ruby version. Probably the path to install gems isn&#8217;t set to unique for every Ruby version you&#8217;ve installed. This may be highly confusing and cause some errors if you use different gem versions for Rails 2.3.x and Rails3 (which is the case in 99% of cases).</p>
<ul>
<li>Supposing you work on Ruby 1.9.2, you type: <em>pik use 192</em>.</li>
<li>Then you can check where is current working dir: <em>which ruby </em>or <em>which rails</em>.</li>
<li>Go to c:/Users/<em>username</em>/.pik/config.yml.</li>
<li>Edit the proper line in YAML file adding the following lines to the chosen Ruby version
<pre class="brush: ruby; title: ; notranslate">
:gem_home: !ruby/object:Pathname
    path: c:/users/greg/.pik/rubies/Ruby-192-p180
</pre>
<p>So that the whole version definifion will look like:</p>
<pre class="brush: ruby; title: ; notranslate">
&quot;192: ruby 1.9.2p180 (2011-02-18) [i386-mingw32]&quot;:
  :gem_home: !ruby/object:Pathname
    path: c:/users/greg/.pik/rubies/Ruby-192-p180
  :path: !ruby/object:Pathname
    path: C:/Users/Greg/.pik/rubies/Ruby-192-p180/bin
</pre>
<p>Mind the spaces and tabs!</li>
</ul>
<p>2. SQLite 3 for Windows needs some additional libraries. You can find them at <a href="http://www.sqlite.org/download.html">http://www.sqlite.org/download.html</a> The solution is simple: download the sqlite3.dll and sqlite3.exe and copy it to your Ruby <em>bin</em> directiory, i.e. <em>C:/Users/Greg/.pik/rubies/Ruby-192-p180/bin</em></p>
<p>I hope this was helpful and saved you some time of your life <img src='http://blog.brzezinka.eu/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ror-plugin-install-from-git-repository-in-windows' rel='bookmark' title='RoR: plugin install from GIT repository in Windows'>RoR: plugin install from GIT repository in Windows</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ror-railroad-plugin-with-rails-2-3-5-on-windows-error' rel='bookmark' title='RoR: Railroad plugin with Rails 2.3.5 on Windows error'>RoR: Railroad plugin with Rails 2.3.5 on Windows error</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails' rel='bookmark' title='Alternative strings&#8217;s delimiter for Ruby (on Rails)'>Alternative strings&#8217;s delimiter for Ruby (on Rails)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/ruby/pik-multiple-ruby-versions-for-windows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternative strings&#8217;s delimiter for Ruby (on Rails)</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=alternative-stringss-delimiter-for-ruby-on-rails</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails#comments</comments>
		<pubDate>Mon, 20 Dec 2010 13:08:11 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=192</guid>
		<description><![CDATA[Defining a string in Ruby is pretty simple: You can use both single and double quotes, however double quotes give you much more &#8211; expressions enclosed in #{} would be processed by Ruby before string is shown. Pretty cool, heh? But I am sure most of you have already known that. Let&#8217;s proceed than: consider [...]


Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels' rel='bookmark' title='Ruby on Rails: i18n form labels'>Ruby on Rails: i18n form labels</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker' rel='bookmark' title='Ruby on Rails + Formtastic + jQuery UI datepicker'>Ruby on Rails + Formtastic + jQuery UI datepicker</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/jquery-in-rails-jrails' rel='bookmark' title='jQuery AJAX in Ruby on Rails'>jQuery AJAX in Ruby on Rails</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Defining a string in Ruby is pretty simple:</p>
<pre class="brush: ruby; title: ; notranslate">
s1 = 'Hello!'
s2 = &quot;This is a string.\n Calculations: 2+2=#{2+2}&quot;
</pre>
<p>You can use both single and double quotes, however double quotes give you much more &#8211; expressions enclosed in <em>#{}</em> would be processed by Ruby before string is shown. Pretty cool, heh?<br />
But I am sure most of you have already known that. Let&#8217;s proceed than: consider you have a string, that contains many mixed quotes (&#8216;) and double quotes (&#8222;). How to write it, if the same marks (&#8216;) and (&#8222;) are considered as string delimiters? Of course you can concatenate string step by step delimiting single quote with double quoted and vice versa, but this is painful. There is a better solution:</p>
<p><span id="more-192"></span></p>
<h3>Custom string delimiters</h3>
<p>Ruby provides a mechanism to define custom string delimiter both as single quoted <em>%q</em> and double quoted <em>%Q</em> string alternative. Let&#8217;s see examples:</p>
<pre class="brush: ruby; title: ; notranslate">
s3 = %q[My dog's name is George &quot;Jonny&quot; the Second] #single quoted string
s4 = %Q/One can define a string by s = &quot;String content&quot; or s2 = 'string2 content'\n Calculations: 2+2=#{2+2}/
</pre>
<p>So as string delimiters one can use a nonalphanumeric character that should go right after <em>%q</em> or <em>%Q</em> and the string should be terminated with the same character. In case you use brackets, you should terminate the string with the corresponding closing bracket.</p>
<h3>Operating system commands</h3>
<p>Strings enclosed with backquotes or %x{} would be considered by Ruby as operating system commands. Just try:</p>
<pre class="brush: ruby; title: ; notranslate">
puts (`calc`)
</pre>
<p>or</p>
<pre class="brush: ruby; title: ; notranslate">
puts (&quot;Current directory content is: #{%x/dir/}&quot;)
</pre>
<h3>HEREDOCS</h3>
<p>The last, but not least neat way to define long, multiline strings is so called HEREDOCS. Let&#8217;s see an example first:</p>
<pre class="brush: ruby; title: ; notranslate">
LongString = &lt;&lt;LINEEND
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the #{15*100}s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived not only five centuries, but also the
 leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s
 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.
LINEEND
</pre>
<p>The HEREDOCs string starts with specifying the end marker (in my example: LINEEND). Everything you write would be treated as doublequoted string till you write the end marker (should be placed nonindendet in a new line).</p>


<p>Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels' rel='bookmark' title='Ruby on Rails: i18n form labels'>Ruby on Rails: i18n form labels</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker' rel='bookmark' title='Ruby on Rails + Formtastic + jQuery UI datepicker'>Ruby on Rails + Formtastic + jQuery UI datepicker</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/jquery-in-rails-jrails' rel='bookmark' title='jQuery AJAX in Ruby on Rails'>jQuery AJAX in Ruby on Rails</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to check if the object/element exist in JavaScript and jQuery?</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-check-if-the-objectelement-exist-in-javascript-and-jquery?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-check-if-the-objectelement-exist-in-javascript-and-jquery</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-check-if-the-objectelement-exist-in-javascript-and-jquery#comments</comments>
		<pubDate>Mon, 13 Dec 2010 22:24:57 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=188</guid>
		<description><![CDATA[The simplest mistake sometimes costs several hours of debugging. One of these is checking if the target exists before trying to apply some changes to/using it. How to check if element in DOM exists, i.e. if the selector $(&#8216;.some_class&#8217;) is not empty? The simplest: will not work! The correct condition uses the .lenght function: Note [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The simplest mistake sometimes costs several hours of debugging. One of these is checking if the target exists before trying to apply some changes to/using it.</p>
<h3>How to check if element in DOM exists, i.e. if the selector $(&#8216;.some_class&#8217;) is not empty?</h3>
<p>The simplest:</p>
<pre class="brush: jscript; title: ; notranslate">
if ($('.some_class')) {
   //some action
}
</pre>
<p>will not work!</p>
<p>The correct condition uses the <em>.lenght</em> function:</p>
<pre class="brush: jscript; title: ; notranslate">
if ($('.some_class').length &gt; 0) {
   //some action
}
</pre>
<p>Note no brackets after <em>.length</em>.</p>
<h3>How to check if JavaScript object&#8217;s property exists?</h3>
<p>This is tricky, as there are two types of properties: <em>own</em> properties and <em>prototype </em>properties. Not going into details, we can assume, that <em>own</em> properties are the one that are for example serialized by JSON, and <em>prototype</em> properties are the one that can be empty or not, but are given in the object&#8217;s definition.</p>
<p>So, in most cases you want to check if the <em>own</em> property exists for the given object. This can be obtained using the <em>hasOwnProperty()</em> method:</p>
<pre class="brush: jscript; title: ; notranslate">
if (the_object.hasOwnProperty(&quot;name)) {
   //some action
}
</pre>
<p>If you only want to check whether there is the <em>prototype</em> property, you may use <em>in</em> operator to determine the existence of the property:</p>
<pre class="brush: jscript; title: ; notranslate">
if (&quot;name&quot; in the_object)) {
   //some action
}
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-check-if-the-objectelement-exist-in-javascript-and-jquery/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to enable the search functionality in jqGrid?</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-enable-the-search-functionality-in-jqgrid?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-enable-the-search-functionality-in-jqgrid</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-enable-the-search-functionality-in-jqgrid#comments</comments>
		<pubDate>Mon, 29 Nov 2010 22:24:10 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jqgrid]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=185</guid>
		<description><![CDATA[jqGrid is a powerful jQuery based, AJAX tool for representing and editing tabular data in many formats (database output in JSON, XML etc.). It is really easy to implement, quite well documented and really easy to style (through jQuery UI themes and its excellent themeroller). I was working on a Joomla-PHP-MySQL project. I have successfully [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.trirand.com/jqgrid/jqgrid.html" target="_blank">jqGrid</a> is a powerful jQuery based, AJAX tool for representing and editing tabular data in many formats (database output in JSON, XML etc.).</p>
<p>It is really easy to implement, quite <a href="http://www.trirand.com/jqgridwiki/doku.php?id=start" target="_blank">well documented</a> and really easy to style (through jQuery UI themes and its excellent <a href="http://jqueryui.com/themeroller/" target="_blank">themeroller</a>).</p>
<p>I was working on a Joomla-PHP-MySQL project. I have successfully enabled the extended show functionality, adding edit option also went smoothly. However, I got a little bit stuck while trying to enable Search. Basing on <a href="http://www.trirand.com/jqgrid/jqgrid.html" target="_blank">demo examples</a> and <a href="http://www.trirand.com/blog/?page_id=393/discussion/php-code-for-building-sql-search-query-where-clause/" target="_blank">some blogs</a>, I have managed to develop a piece of code that successfully made the search work like a charm. Below you&#8217;d find a php file responsible for returning the get xml data request from jqgrid.</p>
<p><span id="more-185"></span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;

//array to translate the search type
$ops = array(
    'eq'=&gt;'=', //equal
    'ne'=&gt;'&lt;&gt;',//not equal
    'lt'=&gt;'&lt;', //less than
    'le'=&gt;'&lt;=',//less than or equal
    'gt'=&gt;'&gt;', //greater than
    'ge'=&gt;'&gt;=',//greater than or equal
    'bw'=&gt;'LIKE', //begins with
    'bn'=&gt;'NOT LIKE', //doesn't begin with
    'in'=&gt;'LIKE', //is in
    'ni'=&gt;'NOT LIKE', //is not in
    'ew'=&gt;'LIKE', //ends with
    'en'=&gt;'NOT LIKE', //doesn't end with
    'cn'=&gt;'LIKE', // contains
    'nc'=&gt;'NOT LIKE'  //doesn't contain
);
function getWhereClause($col, $oper, $val){
    global $ops;
    if($oper == 'bw' || $oper == 'bn') $val .= '%';
    if($oper == 'ew' || $oper == 'en' ) $val = '%'.$val;
    if($oper == 'cn' || $oper == 'nc' || $oper == 'in' || $oper == 'ni') $val = '%'.$val.'%';
    return &quot; WHERE $col {$ops[$oper]} '$val' &quot;;
}
$where = &quot;&quot;; //if there is no search request sent by jqgrid, $where should be empty
$searchField = isset($_GET['searchField']) ? $_GET['searchField'] : false;
$searchOper = isset($_GET['searchOper']) ? $_GET['searchOper']: false;
$searchString = isset($_GET['searchString']) ? $_GET['searchString'] : false;
if ($_GET['_search'] == 'true') {
    $where = getWhereClause($searchField,$searchOper,$searchString);
}

// connect to the database
$dbhost = &quot;host_address&quot;;
$dbuser = &quot;db_user&quot;;
$dbpassword = &quot;db_pass&quot;;
$database = &quot;db_name&quot;;
$tablename
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die(&quot;Connection Error: &quot; . mysql_error());

mysql_select_db($database) or die(&quot;Error conecting to db.&quot;);
mysql_set_charset('utf8',$database);
mysql_query(&quot;SET NAMES 'utf8'&quot;);
$result = mysql_query(&quot;SELECT COUNT(*) AS count FROM $tablename&quot;);
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];

if( $count &gt;0 ) {
	$total_pages = ceil($count/$limit);
} else {
	$total_pages = 0;
}
if ($page &gt; $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = &quot;SELECT field1, field2, field3, field4, field5 FROM $tablename &quot;
.$where.&quot; ORDER BY $sidx $sord LIMIT $start , $limit&quot;;
$result = mysql_query( $SQL ) or die(&quot;Couldn?t execute query.&quot;.mysql_error());

if ( stristr($_SERVER[&quot;HTTP_ACCEPT&quot;],&quot;application/xhtml+xml&quot;) ) {
header(&quot;Content-type: application/xhtml+xml;charset=utf-8&quot;); } else {
header(&quot;Content-type: text/xml;charset=utf-8&quot;);
}
$et = &quot;&gt;&quot;;

echo &quot;&lt;?xml version='1.0' encoding='utf-8'?$et\n&quot;;
echo &quot;&lt;rows&gt;&quot;;
echo &quot;&lt;page&gt;&quot;.$page.&quot;&lt;/page&gt;&quot;;
echo &quot;&lt;total&gt;&quot;.$total_pages.&quot;&lt;/total&gt;&quot;;
echo &quot;&lt;records&gt;&quot;.$count.&quot;&lt;/records&gt;&quot;;
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
	echo &quot;&lt;row id='&quot;. $row[field1].&quot;'&gt;&quot;;
	echo &quot;&lt;cell&gt;&quot;. $row[field1].&quot;&lt;/cell&gt;&quot;;
	echo &quot;&lt;cell&gt;&quot;. $row[field2].&quot;&lt;/cell&gt;&quot;;
	echo &quot;&lt;cell&gt;&lt;![CDATA[&quot;. $row[field3].&quot;]]&gt;&lt;/cell&gt;&quot;;
	echo &quot;&lt;cell&gt;&quot;. $row[field4].&quot;&lt;/cell&gt;&quot;;
	echo &quot;&lt;cell&gt;&quot;. $row[field5].&quot;&lt;/cell&gt;&quot;;
	echo &quot;&lt;/row&gt;&quot;;
}
echo &quot;&lt;/rows&gt;&quot;;
?&gt;
</pre>
<p>If you perform the search in jqgrid, the following variables are set in the request:</p>
<ul>
<li><em>_search = TRUE</em></li>
<li><em>searchField</em> &#8211; the name of the field defined in colModel</li>
<li><em>searchString</em> &#8211; the string typed in the search field</li>
<li><em>searchOper</em> &#8211; the operator choosen in the search field (ex. equal, greater than, &#8230;)</li>
</ul>
<p>The <em>$ops</em> array converts the <em>searchOper</em> into the SQL-compatible command (<em>equal</em> -&gt; &#8216;=&#8217;, <em>greated or equal</em> -&gt; &#8216;&gt;=&#8217;, etc.). The getWhereClause generated the <em>WHERE</em> piece of statement, including the modification of <em>searchString</em> in case of some types of search (ex. &#8216;%&#8217; sign in case of <em>LIKE</em>). Then we just check if the <em>_SEARCH</em> variable is <strong>true</strong>, and if so the $where statement is added to the query. The rest of the code is just the same as in the jqgrid demo.</p>
<p>Good luck, in case of questions, drop a comment below.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/jquery/how-to-enable-the-search-functionality-in-jqgrid/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails CMS</title>
		<link>http://blog.brzezinka.eu/uncategorized/ruby-on-rails-cms?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ruby-on-rails-cms</link>
		<comments>http://blog.brzezinka.eu/uncategorized/ruby-on-rails-cms#comments</comments>
		<pubDate>Mon, 27 Sep 2010 19:14:51 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=176</guid>
		<description><![CDATA[I was working on project, that part was a basic tree-like structure of static pages, that needed kind of CMS for client. I had two solutions: implement awesome_nested_set + rails-ckeditor + paperclip find a ready-to-go solution After a little bit of googling tens of out-of-date pages&#038;blogs, I ended up on a great website http://www.whichrubycmsshouldiuse.com/ by [...]


Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/jquery-in-rails-jrails' rel='bookmark' title='jQuery AJAX in Ruby on Rails'>jQuery AJAX in Ruby on Rails</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels' rel='bookmark' title='Ruby on Rails: i18n form labels'>Ruby on Rails: i18n form labels</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker' rel='bookmark' title='Ruby on Rails + Formtastic + jQuery UI datepicker'>Ruby on Rails + Formtastic + jQuery UI datepicker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was working on project, that part was a basic tree-like structure of static pages, that needed kind of CMS for client. I had two solutions: </p>
<ol>
<li>implement <a href="http://github.com/collectiveidea/awesome_nested_set">awesome_nested_set</a> + <a href="http://github.com/standout/rails-ckeditor">rails-ckeditor</a> + <a href="http://github.com/thoughtbot/paperclip">paperclip</a></li>
<li>find a ready-to-go solution</li>
</ol>
<p>After a little bit of googling tens of out-of-date pages&#038;blogs, I ended up on a great website <a href="http://www.whichrubycmsshouldiuse.com/">http://www.whichrubycmsshouldiuse.com/</a> by Youssef Chaker.<br />
<span id="more-176"></span></p>
<p>I decided to give a try to <a href="http://www.browsercms.org/">BrowserCMS</a>, as I can easily integrate it with exisiting project that only part is going to be controlled by CMS.</p>
<p>I have made my mind basing on two nice comparisons found on <a href="http://www.whichrubycmsshouldiuse.com/">http://www.whichrubycmsshouldiuse.com/</a>: </p>
<table>
<thead>
<tr>
<th></th>
<th>Drupal</th>
<th>BrowserCMS</th>
<th>Radiant</th>
<th>adva-cms</th>
</tr>
</thead>
<tbody>
<tr>
<th>Links</th>
<td>	<a href="http://drupal.org/" title="Drupal Homepage Link">homepage</a> &#8211; <a href="http://drupal.org/handbooks" title="Drupal Documentation Link">documentation</a> &#8211; <a href="http://drupal.org/project/modules" title="Drupal Modules Repo Link">modules repo</a> </td>
<td> <a href="http://www.browsercms.org/" title="BrowserCMS Homepage Link">homepage</a> &#8211; <a href="http://github.com/browsermedia/browsercms" title="BrowserCMS Repo Link">repo</a> &#8211; <a href="http://www.browsercms.org/doc/guides/html/index.html" title="BrowserCMS Documentation Link">documentation</a> &#8211; <a href="http://github.com/browsermedia/" title="BrowserCMS Modules Repo Link">modules repo</a> </td>
<td> <a href="http://radiantcms.org/" title="Radiant Homepage Link">homepage</a> &#8211; <a href="http://github.com/radiant/radiant" title="Radiant Repo Link">repo</a> &#8211; <a href="http://wiki.github.com/radiant/radiant/" title="Radiant Documentation Link">documentation</a> &#8211; <a href="http://ext.radiantcms.org/" title="Radiant Modules Repo Link">modules repo</a> </td>
<td> <a href="http://adva-cms.org/wiki" title="adva-cms Homepage Link">homepage</a> &#8211; <a href="http://github.com/svenfuchs/adva_cms" title="adva-cms Repo Link">repo</a> &#8211; <a href="http://adva-cms.org/wiki" title="adva-cms Documentation Link">documentation</a> </td>
</tr>
<tr>
<th>Documentation</th>
<td> Core documentation is ok, but very brief and rarely helpful. Forums are messy, long and badly organized. Documentation for Drupal 5 gets mixed with those of Drupal 6. </td>
<td> Not complete, there is enough to get you started and the responses to the mailing list are fast. But documentation definitely needs completion and expansion. </td>
<td> Extensive documentation with more than a 100 wiki pages. Great support on the mailing list and by community. </td>
<td> Limited documentation (probably because there is little to document!). </td>
</tr>
<tr>
<th>Installing</th>
<td> Manageable: download the source code, configure a settings file or two, create your DB and run the installation script (all of it has to be done each time). </td>
<td> Easy: Install the gem (once), create your Rails app using the template, create your DB and run the rake tasks. </td>
<td>  Easy: Install the gem (once), create your Radiant app, create your DB and run the rake tasks. </td>
<td> Very Easy: Create your DB, create your Rails app using the template, and fill the simple form. </td>
</tr>
<tr>
<th>Upgrading</th>
<td> Ridiculously difficult, specially if you are using <span class="caps">SVN</span> in your team for source control. </td>
<td> Piece of cake, install the appropriate gem version and regenerate the file. </td>
<td> Fairly simple, also requires updating the gem and then updating the Radiant assets in your project </td>
<td> No clue, sorry! </td>
</tr>
<tr>
<th>Theming</th>
<td> Requires creating multiple templates (one general page template and then one for each section or view) and multiple hook functions. Keeping track of all the places to commit changes can get too cumbersome. People using a <span class="caps">CMS</span> want to develop their website in their web browser and Drupal forces designers to work with source code. </td>
<td> Have to create template files, but development can happen in the browser. Only need upload a <span class="caps">CSS</span> file with your project. </td>
<td> Everything happens in the browser, even creating stylesheets. ALso provides ability for templates to inherit from other templates. </td>
<td> Everything happens in the browser, with also the ability to upload existing files into your theme. </td>
</tr>
<tr>
<th>Modules/Extensions (list)</th>
<td> A huge list of modules is available, one of the compelling things about this <span class="caps">CMS</span> </td>
<td> Very short and limited list, but that might change soon. And the ease of writing your own makes up for it. </td>
<td> A good size list with probably everything you might need. </td>
<td> Small number of extensions that all come with the template. </td>
</tr>
<tr>
<th>Modules/Extensions (creating your own)</th>
<td> It requires writing <span class="caps">PHP</span> code, need I say more? I guess I will anyway, you will need to know all the hooks and weird function names that will make your module work. No separation of code between business logic and view logic. Did I mention <span class="caps">PHP</span> already? </td>
<td> Develop Rails models that hook into the <span class="caps">CMS</span> through magic words.  </td>
<td> Create a Rails app using all the awesome things it provides and then copy the necessary files over as an extension. </td>
<td> Can use the Rails Engine plugins system to create extensions. Or create your custom <span class="caps">MVC</span> content just like you would with a regular Rails app. </td>
</tr>
<tr>
<th>Extended Custom Functionality</th>
<td> Done through modules. </td>
<td> Achieved just like in any other Rails app. </td>
<td> Done through extensions. </td>
<td> Achieved just like in any other Rails app. </td>
</tr>
<tr>
<th>Hooking to Existing App</th>
<td> It is your app! </td>
<td> Seamless integration. The <span class="caps">CMS</span> runs through the gem and is completely separate for the rest of the app. </td>
<td> It is your main app. With possibility of integration through Rails Rack. </td>
<td> Allows the possibility to import existing app into the project (involves copying the files over). Building a custom application on top of the <span class="caps">CMS</span> is the better way of going about it. </td>
</tr>
<tr>
<th><span class="caps">WYSIWYG</span>/Rich Text Editor</th>
<td> Available through a module. </td>
<td> Native. </td>
<td> Available through extension. </td>
<td> Available through the extension, has to be enabled through settings. </td>
</tr>
<tr>
<th>File Attachments</th>
<td> Available through a module. </td>
<td> Native. </td>
<td>  Available through extension. </td>
<td> Native. </td>
</tr>
<tr>
<th>Extra, Cool Features</th>
<td> Views and <span class="caps">CCK</span>. </td>
<td> Some sort of in place editing. Ability to create subparts of pages that can be easily shared. </td>
<td> Ability to setup a blog quickly through the database template at installation. </td>
<td> Multiple Site support. </td>
</tr>
</tbody>
<tfoot>
<tr>
<em>source: <a href="http://www.whichrubycmsshouldiuse.com/2010/01/12/recap-of-first-two-weeks.html">http://www.whichrubycmsshouldiuse.com/2010/01/12/recap-of-first-two-weeks.html</a></em><br />
</tr>
</tfoot>
</table>
<p>And:</p>
<table>
<thead>
<tr>
<th></th>
<th>BrowserCMS</th>
<th>Radiant</th>
<th>adva-cms (all the extensions come with the <span class="caps">CMS</span>, look at the previous posts for more info)</th>
<th>Wild Card Entry: <a href="communit-engine-home" title="Community Engine Home Page">Community Engine</a> </th>
</tr>
</thead>
<tbody>
<tr>
<th>News</th>
<td> <a href="http://github.com/browsermedia/bcms_news" title="BrowserCMS News Module">news</a>	</td>
<td> <a href="http://ext.radiantcms.org/extensions/70-news" title="Radiant News Extension">news</a> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th>Blog</th>
<td>	<a href="http://github.com/browsermedia/bcms_blog" title="BrowserCMS Blog Module">blog</a> </td>
<td> Radiant is built to support blogs out of the box but a couple of extensions provide more support: <a href="http://ext.radiantcms.org/extensions/30-blog" title="Radiant Blog Extension">blog</a> &#8211; <a href="http://ext.radiantcms.org/extensions/38-blog-tags" title="Radiant Blog Tags Extension">blog-tags</a> </td>
<td> adva_blog </td>
<td> built in </td>
</tr>
<tr>
<th>Forum</th>
<td> </td>
<td> <a href="http://ext.radiantcms.org/extensions/156-forum" title="Radiant Forum Extension">forum</a> &#8211; <a href="http://ext.radiantcms.org/extensions/160-group-forum" title="Radiant Group Forum Extension">group-forum</a> </td>
<td> adva_forum </td>
<td> built in </td>
</tr>
<tr>
<th>Newsletters</th>
<td>	</td>
<td> <a href="http://ext.radiantcms.org/extensions/155-reader" title="Radiant Reader Extension">reader</a> &#8211; <a href="http://ext.radiantcms.org/extensions/159-reader-group" title="Radiant Reader Group Extension">reader-group</a>. The reader extension is used across the board (users registration, forum, etc.) </td>
<td> adva_newsletter </td>
<td> built in through private messaging </td>
</tr>
<tr>
<th>Multimedia</th>
<td>	available through attachments </td>
<td> <a href="http://ext.radiantcms.org/extensions/20-paperclipped" title="Radiant Paperclipped Extension">paperclipped</a> &#8211; <a href="http://ext.radiantcms.org/extensions/166-paperclipped-player" title="Radiant Paperclipped Player Extension">paperclipped-player</a> &#8211; <a href="http://ext.radiantcms.org/extensions/165-paperclipped-uploader" title="Radiant Paperclipped Uploader Extension">paperclipped-uploader</a> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th>Community/Users</th>
<td>	</td>
<td> <a href="http://ext.radiantcms.org/extensions/122-members" title="Radiant Members Extension">members</a> &#8211; <a href="http://ext.radiantcms.org/extensions/155-reader" title="Radiant Reader Extension">reader</a> </td>
<td> adva_user &#8211; adva_activity </td>
<td> built in </td>
</tr>
</tbody>
<tfoot>
<tr><em>Source:<a href="http://www.whichrubycmsshouldiuse.com/2010/02/10/evaluation-for-project.html"> http://www.whichrubycmsshouldiuse.com/2010/02/10/evaluation-for-project.html</a></em></tr>
</tfoot>
</table>
<p>I hope it will help you too!</p>


<p>Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/jquery-in-rails-jrails' rel='bookmark' title='jQuery AJAX in Ruby on Rails'>jQuery AJAX in Ruby on Rails</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels' rel='bookmark' title='Ruby on Rails: i18n form labels'>Ruby on Rails: i18n form labels</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker' rel='bookmark' title='Ruby on Rails + Formtastic + jQuery UI datepicker'>Ruby on Rails + Formtastic + jQuery UI datepicker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/uncategorized/ruby-on-rails-cms/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: i18n form labels</title>
		<link>http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ruby-on-rails-i18n-form-labels</link>
		<comments>http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels#comments</comments>
		<pubDate>Sat, 24 Jul 2010 23:40:38 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://blog.brzezinka.eu/?p=173</guid>
		<description><![CDATA[In Rails &#60;=2.3 i18n internationalization does not include translation of form labels. However, this can be easily fixed by installing the patch i18n_label by iain. For your Rails project, just install plugin: Now you should just add appropriate entries to your locale file. I&#8217;d explain it in the example below. I have the following form [...]


Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker' rel='bookmark' title='Ruby on Rails + Formtastic + jQuery UI datepicker'>Ruby on Rails + Formtastic + jQuery UI datepicker</a></li>
<li><a href='http://blog.brzezinka.eu/uncategorized/ruby-on-rails-cms' rel='bookmark' title='Ruby on Rails CMS'>Ruby on Rails CMS</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails' rel='bookmark' title='Alternative strings&#8217;s delimiter for Ruby (on Rails)'>Alternative strings&#8217;s delimiter for Ruby (on Rails)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In Rails &lt;=2.3 i18n internationalization does not include translation of form labels. However, this can be easily fixed by installing the patch <strong><a href="http://github.com/iain/i18n_label" target="_blank">i18n_label</a></strong> by<a href="http://github.com/iain" target="_blank"> iain</a>. For your Rails project, just install plugin:</p>
<pre class="brush: plain; title: ; notranslate">ruby script/plugin install git://github.com/iain/i18n_label.git</pre>
<p>Now you should just add appropriate entries to your locale file. I&#8217;d explain it in the example below.<br />
I have the following form to the model <em>Post</em>:</p>
<pre class="brush: ruby; title: ; notranslate">
&lt;% form_for :post do |f| -%&gt;
  &lt;%= f.error_messages %&gt;

  &lt;p&gt;&lt;%= f.label :name %&gt;&lt;/p&gt;
  &lt;p&gt;&lt;%= f.text_field :name %&gt;&lt;/p&gt;

  &lt;p&gt;&lt;%= f.submit &quot;Wyślij&quot; %&gt;&lt;/p&gt;
&lt;% end -%&gt;
</pre>
<p>I want the label <em>:name</em> to be automatically translated according to the entry in locales. Taking as an example polish locale <em>pl.yml</em>, we have to create new entry:</p>
<pre class="brush: ruby; title: ; notranslate">
pl:
  activerecord:
    models:
      post: &quot;Wiadomości&quot;
    attributes:
      post:
        name: &quot;Nazwa&quot;
</pre>
<p>&#8230;and that&#8217;s all! After restarting the project, the form labels are successfully tanslated according to locale entries!</p>


<p>Related posts:<ol><li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker' rel='bookmark' title='Ruby on Rails + Formtastic + jQuery UI datepicker'>Ruby on Rails + Formtastic + jQuery UI datepicker</a></li>
<li><a href='http://blog.brzezinka.eu/uncategorized/ruby-on-rails-cms' rel='bookmark' title='Ruby on Rails CMS'>Ruby on Rails CMS</a></li>
<li><a href='http://blog.brzezinka.eu/webmaster-tips/ruby/alternative-stringss-delimiter-for-ruby-on-rails' rel='bookmark' title='Alternative strings&#8217;s delimiter for Ruby (on Rails)'>Alternative strings&#8217;s delimiter for Ruby (on Rails)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-i18n-form-labels/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

