<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Kolodvor</title>
	
	<link>http://kolodvor.net</link>
	<description>ruby rails javascript jquery prototype radiant ...</description>
	<lastBuildDate>Thu, 25 Feb 2010 11:09:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kolodvor" /><feedburner:info uri="kolodvor" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Create new app with specific Rails version</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/WxP2_xgZjyE/</link>
		<comments>http://kolodvor.net/2010/02/25/create-new-app-with-specific-rails-version/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 11:09:50 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=153</guid>
		<description><![CDATA[I recently installed Rails 3 beta release but I needed to create new app with the 2.3.5. version. I was searching for a way to do that and I found this

  rails _2.3.5_ appname

Unfortunately this will produce an error similar to this

  /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: railties(3.0.0.beta not = 2.3.5) (Gem::LoadError)
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:261:in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed Rails 3 beta release but I needed to create new app with the 2.3.5. version. I was searching for a way to do that and I found this</p>
<pre class="code">
  rails _2.3.5_ appname
</pre>
<p>Unfortunately this will produce an error similar to this</p>
<pre class="code">
  /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: railties(3.0.0.beta not = 2.3.5) (Gem::LoadError)
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:261:in `activate'
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:68:in `gem'
	from /usr/local/bin/rails3:18
</pre>
<p>To fix this first run </p>
<pre class="code">
  which rails
</pre>
<p>and you will get a path to your rails executable, in my case this is <code>/usr/local/bin/rails</code>.</p>
<p>Then copy <code>rails</code> to <code>rails3</code>.</p>
<pre class="code">
  sudo cp /usr/local/bin/rails /usr/local/bin/rails3
</pre>
<p>Then open this file in your text editor (TextMate in my case).</p>
<pre class="code">
  mate /usr/local/bin/rails
</pre>
<p>and replace two last lines so that your file now looks like </p>
<pre class="code">
  require 'rubygems'

  version = ">= 0"

  if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
    version = $1
    ARGV.shift
  end

  gem 'rails', version
  load 'rails'
</pre>
<p>Thats it, now you can create your app with specific Rails version with</p>
<pre class="code">
  rails _2.3.5_ appname
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2010/02/25/create-new-app-with-specific-rails-version/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2010/02/25/create-new-app-with-specific-rails-version/</feedburner:origLink></item>
		<item>
		<title>View man documentation in Preview</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/5l3We2smnQE/</link>
		<comments>http://kolodvor.net/2010/02/12/view-man-documentation-in-preview/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 08:12:12 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=134</guid>
		<description><![CDATA[If you are on OSX you can easily open man documentation using Preview. Just replace ls with command you would like to see documentation for.

 man -t "ls" &#124; open -f -a /Applications/Preview.app/

If you plan to do this often, you can make your life much easier by putting this inside your .bash_profile.

 pman ()
 {
 [...]]]></description>
			<content:encoded><![CDATA[<p>If you are on OSX you can easily open man documentation using Preview. Just replace <code>ls</code> with command you would like to see documentation for.</p>
<pre class="code">
 man -t "ls" | open -f -a /Applications/Preview.app/
</pre>
<p>If you plan to do this often, you can make your life much easier by putting this inside your <code>.bash_profile</code>.</p>
<pre class="code">
 pman ()
 {
   man -t "${1}" | open -f -a /Applications/Preview.app/
 }
</pre>
<p>Now you can use following to view documentation in Preview</p>
<pre class="code">
 pman ls
</pre>
<p>Credit goes to <a href="http://wiseheartdesign.com/articles/2010/02/12/my-current-toolset/">John W. Long</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2010/02/12/view-man-documentation-in-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2010/02/12/view-man-documentation-in-preview/</feedburner:origLink></item>
		<item>
		<title>Ruby library for parsing, validating and formatting phone numbers</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/AY3wm1rYokc/</link>
		<comments>http://kolodvor.net/2010/01/04/ruby-library-for-parsing-validating-and-formatting-phone-numbers/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 16:19:39 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[phone numbers]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=107</guid>
		<description><![CDATA[Tomislav Car has just released Phone, Ruby library for phone number parsing, validation and formatting. It should save you a lot of time if you need any of the following:
* you have area where users input phone numbers in many different formats
* output phone numbers in specific format
* you need to send SMS messages from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/carr">Tomislav Car</a> has just released <a href="http://github.com/carr/phone">Phone</a>, Ruby library for phone number parsing, validation and formatting. It should save you a lot of time if you need any of the following:</p>
<p>* you have area where users input phone numbers in many different formats<br />
* output phone numbers in specific format<br />
* you need to send SMS messages from your app<br />
* &#8230;</p>
<p><span id="more-107"></span></p>
<p>You can initialize new Phone object with <code>Phone.new</code></p>
<pre class="code">
  Phone.new('5125486', '91', '385')
</pre>
<p>or</p>
<pre class="code">
  Phone.new(:number => '5125486', :area_code => '91', :country_code => '385')
</pre>
<p>Parsing is done using <code>Phone.parse</code> method</p>
<pre class="code">
    Phone.parse '091/512-5486', :country_code => '385'
    Phone.parse '(091) 512 5486', :country_code => '385'
</pre>
<p>It is smart to set default contry code first so you don&#8217;t have to provide it as option every time</p>
<pre class="code">
    Phone.default_country_code = '385'
    Phone.parse '091/512-5486'
    Phone.parse '(091) 512 5486'
</pre>
<p><span style="text-decoration:line-through">Fow now, Phone works only for Croatian, Slovenian, Bosnian and Serbian phone numbers, but Tomislav is collecting data to support other countries.</span></p>
<p><a href="http://github.com/carr/phone">Go check it out</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2010/01/04/ruby-library-for-parsing-validating-and-formatting-phone-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2010/01/04/ruby-library-for-parsing-validating-and-formatting-phone-numbers/</feedburner:origLink></item>
		<item>
		<title>Set focus on first field with Prototype</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/UHWxmf_pGI8/</link>
		<comments>http://kolodvor.net/2010/01/02/set-focus-on-first-field-with-prototype/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 14:32:02 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[selectors]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=91</guid>
		<description><![CDATA[If you are using jQuery see this post.
To set focus on first text field with Prototype I prefer something like this

  var firstField = $$('input:text:visible').first();
  if (firstField)
    firstField.focus();

but you can also try with Form.focusFirstElement or Form.findFirstElement
3RAWXQXCQDMZ
]]></description>
			<content:encoded><![CDATA[<p>If you are using <a href="http://www.jquery.com">jQuery</a> see <a href="http://kolodvor.net/2008/01/17/set-focus-on-first-field-with-jquery">this</a> post.</p>
<p>To set focus on first text field with Prototype I prefer something like this</p>
<pre class="code">
  var firstField = $$('input:text:visible').first();
  if (firstField)
    firstField.focus();
</pre>
<p>but you can also try with <a href="http://api.prototypejs.org/dom/form.html#focusfirstelement-class_method">Form.focusFirstElement</a> or <a href="http://api.prototypejs.org/dom/form.html#findfirstelement-class_method">Form.findFirstElement</a></p>
<p>3RAWXQXCQDMZ</p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2010/01/02/set-focus-on-first-field-with-prototype/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2010/01/02/set-focus-on-first-field-with-prototype/</feedburner:origLink></item>
		<item>
		<title>Rails, CSRF and Ajax requests</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/rDbJv5cEzJU/</link>
		<comments>http://kolodvor.net/2010/01/02/rails-csrf-and-ajax-requests/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 00:36:03 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[csrf]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[forgery]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[token]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=64</guid>
		<description><![CDATA[Rails protects controller actions from CSRF (Cross-Site Request Forgery) attacks with a token based on a random string stored in the session. The token parameter is named authenticity_token by default and will be embedded  in all forms and Ajax requests generated by Rails.
You should also add this token to all Ajax request that you [...]]]></description>
			<content:encoded><![CDATA[<p>Rails protects controller actions from <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF</a> (Cross-Site Request Forgery) attacks with a token based on a random string stored in the session. The token parameter is named <code>authenticity_token</code> by default and will be embedded  in all forms and Ajax requests generated by Rails.</p>
<p>You should also add this token to all Ajax request that you hand coded. As suggested in <a href="http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html#M000514">Rails documentation</a> you can add this line in <code>head</code> section.</p>
<pre class="code">
  &lt;%= javascript_tag "window._token = '#{form_authenticity_token}'" %&gt;
</pre>
<p>and then add authenticity_token to parameters option of Ajax requests</p>
<pre class="code">
  new Ajax.Request('/some/url', {
    parameters: "foo=bar&#038;authenticity_token="+_token
  });
</pre>
<h3>Remote forgery protection plugin</h3>
<p>This can get tedious if you have a lot of Ajax requests so I wrote a simple <a href="http://github.com/vlado/remote_forgery_protection">plugin</a> that adds authenticity token to all Ajax requests automatically.</p>
<p>You can install it with</p>
<pre class="code">
  script/plugin install git://github.com/vlado/remote_forgery_protection.git
</pre>
<p>Now all you have to do is add this line inside <code>head</code> section of you&#8217;re layout</p>
<pre class="code">
  &lt;%= remote_forgery_protection %&gt;
</pre>
<p>and all non GET Ajax request will have authenticity_token parameter automatically included.</p>
<p><span id="more-64"></span></p>
<p><span style="text-decoration:line-through">Magic is done by wrapping Ajax.Base using <a href="http://api.prototypejs.org/language/function.html#wrap-instance_method">Function#wrap</a> method so this will work only if you are using <a href="http://prototypejs.org">Prototype</a>.<br />
I plan to add support for other libraries (if there is interest) in the future so keep in touch.</span></p>
<p>Remote forgery protection currently supports <a href="http://www.prototypejs.org">Prototype</a>, <a href="http://www.jquery.com">jQuery</a> and <a href="http://www.extjs.com">ExtJS</a>. Let me know if you would like to see it working with some other library</p>
<p>Plugin page: <a href="http://github.com/vlado/remote_forgery_protection">http://github.com/vlado/remote_forgery_protection</a></p>
<p>More info:<br />
<a href="http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html">api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html</a><br />
<a href="http://isc.sans.org/diary.html?storyid=1750">isc.sans.org/diary.html?storyid=1750</a><br />
<a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">en.wikipedia.org/wiki/Cross-site_request_forgery</a><br />
<a href="http://opensoul.org/2008/10/24/ajax-and-request-forgery-protection">opensoul.org/2008/10/24/ajax-and-request-forgery-protection</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2010/01/02/rails-csrf-and-ajax-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2010/01/02/rails-csrf-and-ajax-requests/</feedburner:origLink></item>
		<item>
		<title>Radiant CMS, disable caching in development</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/m4qshj09h6s/</link>
		<comments>http://kolodvor.net/2009/09/19/radiant-cms-disable-caching-in-development/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 20:14:19 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=51</guid>
		<description><![CDATA[I am working on extension for Radiant CMS. I wanted to disable caching for development, but wasn&#8217;t able to find right method for this, so finally I did it by putting this into my extensions activate method

if RAILS_ENV=="development"
  Page.class_eval {
    def cache?
      false
    [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on extension for <a href="http://radiantcms.org">Radiant CMS</a>. I wanted to disable caching for development, but wasn&#8217;t able to find right method for this, so finally I did it by putting this into my extensions activate method</p>
<pre class="code">
if RAILS_ENV=="development"
  Page.class_eval {
    def cache?
      false
    end
  }
end
</pre>
<p>This is more of a hack then a real solution, so please use comments to point me in the right direction. I&#8217;m using Radiant version 0.8.1.</p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2009/09/19/radiant-cms-disable-caching-in-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2009/09/19/radiant-cms-disable-caching-in-development/</feedburner:origLink></item>
		<item>
		<title>Stripe table rows with Prototype</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/4_S_ldcwFEo/</link>
		<comments>http://kolodvor.net/2009/09/16/stripe-table-rows-with-prototype/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 20:35:30 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[stripe rows]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[zebra]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=19</guid>
		<description><![CDATA[I&#8217;ve spend a lot of time with Prototype last few days, and this is going to be my first post related to prototype. So let&#8217;s see how to stripe the table using prototype, I think you will be surprised how easy it is.
HTML for our table will look like


&#60;table class="zebra"&#62;
  &#60;thead&#62;
    [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spend a lot of time with <a href="http://www.prototypejs.org">Prototype</a> last few days, and this is going to be my first post related to prototype. So let&#8217;s see how to stripe the table using prototype, I think you will be surprised how easy it is.</p>
<p>HTML for our table will look like</p>
<p><span id="more-19"></span></p>
<pre class="code">
&lt;table class="zebra"&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Col1&lt;/th&gt;
      &lt;th&gt;Col2&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;11&lt;/td&gt;
      &lt;td&gt;12&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;21&lt;/td&gt;
      &lt;td&gt;22&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;31&lt;/td&gt;
      &lt;td&gt;32&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</pre>
<p>We will also need some CSS to change the background of the even rows and to highlight the row mouse is over</p>
<pre class="code">
table.zebra tr.even {
  background-color:#eee;
}
table.zebra tr:hover {
  background-color:#ccc;
}
</pre>
<p>And now all we need is as simple as</p>
<pre class="code">
$$('table.zebra tbody tr:nth-child(even)').each(function(tr) {
  tr.addClassName('even');
});
</pre>
<p>One thing to notice is that <span style="font-style:italic">tr:hover</span> selector won&#8217;t work in IE 6. If you care about IE6, solution could be to observe row for mouseover event and to add hover class dynamically.</p>
<p>You should add</p>
<pre class="code">
$$('table.zebra tbody tr').each(function(tr) {
  tr.observe('mouseover', function() {
    tr.addClassName('hover');
  }
});
</pre>
<p>and change <span style="font-style:italic">table.zebra tr:hover</span> to </p>
<pre class="code">
table.zebra tr.hover {
  background-color:#ccc;
}
</pre>
<p>Looks like this won&#8217;t be a last post devoted to <a href="http://www.prototypejs.org">Prototype</a> <img src='http://kolodvor.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2009/09/16/stripe-table-rows-with-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2009/09/16/stripe-table-rows-with-prototype/</feedburner:origLink></item>
		<item>
		<title>Set focus on first field with jQuery</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/1IQ8SyaXOBQ/</link>
		<comments>http://kolodvor.net/2008/01/17/set-focus-on-first-field-with-jquery/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 17:50:41 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[selectors]]></category>

		<guid isPermaLink="false">http://kolodvor.net/2008/01/17/set-focus-on-first-field-with-jquery/</guid>
		<description><![CDATA[f you are using Prototype see this post.
Setting focus on the first text field with jQuery is as simple as

  $("input:text:first").focus();
  $("input:text:visible:first").focus();

Find more at http://docs.jquery.com/Selectors
Update: If you are on Rails use auto_focusable_forms, dependency free plugin that will focus first input for you.
]]></description>
			<content:encoded><![CDATA[<p>f you are using <a href="http://www.prototype.org">Prototype</a> see <a href="http://kolodvor.net/2010/01/02/set-focus-on-first-field-with-prototype">this</a> post.</p>
<p>Setting focus on the first text field with <a href="http://www.jquery.com">jQuery</a> is as simple as</p>
<pre class="code">
  <span style="text-decoration:line-through">$("input:text:first").focus();</span>
  $("input:text:visible:first").focus();
</pre>
<p>Find more at <a href="http://docs.jquery.com/Selectors">http://docs.jquery.com/Selectors</a></p>
<p><strong>Update</strong>: If you are on <a href="http://rubyonrails.org">Rails</a> use <a href="http://github.com/dcadenas/auto_focusable_forms/tree/master">auto_focusable_forms</a>, dependency free plugin that will focus first input for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2008/01/17/set-focus-on-first-field-with-jquery/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2008/01/17/set-focus-on-first-field-with-jquery/</feedburner:origLink></item>
		<item>
		<title>Blur links with jQuery</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/Sjc9A5oU4ls/</link>
		<comments>http://kolodvor.net/2007/12/08/blurring-links-with-jquery/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 23:30:22 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://kolodvor.net/2007/12/08/blurring-links-with-jquery/</guid>
		<description><![CDATA[While surfing the Web, you probably noticed the dotted outline, that appears when you click on the link. If your link doesn&#8217;t lead to another page, but instead triggers some event in the same page, outline stays there and looks ugly.
For modern browsers you can remove it with simple css:

a:focus, a:active {
  outline:none;
}

Unfortunately, this [...]]]></description>
			<content:encoded><![CDATA[<p>While surfing the Web, you probably noticed the dotted outline, that appears when you click on the link. If your link doesn&#8217;t lead to another page, but instead triggers some event in the same page, outline stays there and looks ugly.</p>
<p>For modern browsers you can remove it with simple css:</p>
<pre class="code">
a:focus, a:active {
  outline:none;
}
</pre>
<p>Unfortunately, this won&#8217;t do for IE 6 and earlier.</p>
<p>With jQuery it&#8217;s easy to get rid of the outline in every browser that has JavaScript enabled:</p>
<pre class="code">
$("a").click(function() {
  $(this).blur();
});
</pre>
<p>This will remove outline from the link once he is clicked. You will see the outline when clicking, but it will not stay there.</p>
<p>If you don&#8217;t want to se the outline at all replace click event with focus event:</p>
<pre class="code">
$("a").focus(function() {
  $(this).blur();
});
</pre>
<p>To find more about jQuery Events visit <a href="http://docs.jquery.com/Events">http://docs.jquery.com/Events</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2007/12/08/blurring-links-with-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2007/12/08/blurring-links-with-jquery/</feedburner:origLink></item>
		<item>
		<title>Disabeling sessions in Rails</title>
		<link>http://feedproxy.google.com/~r/kolodvor/~3/0gUjmladlf4/</link>
		<comments>http://kolodvor.net/2007/11/23/disabling-sessions-in-rails/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 09:35:09 +0000</pubDate>
		<dc:creator>vlado</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://kolodvor.net/?p=9</guid>
		<description><![CDATA[The simplest way to disable sessions in Rails is to use session  ff (see ActionController::SessionManagement::ClassMethods).
session  ff
To disable session suport only for a specific controller add session  ff to that controller

class MyController < ApplicationController
    session  ff
end

Written like that, sessions are disabled for all actions on this controller.
Like filters, you [...]]]></description>
			<content:encoded><![CDATA[<p>The simplest way to disable sessions in Rails is to use <span class="code">session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff</span> (see <a href="http://api.rubyonrails.com/classes/ActionController/SessionManagement/ClassMethods.html">ActionController::SessionManagement::ClassMethods</a>).</p>
<h3>session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff</h3>
<p>To disable session suport only for a specific controller add <span class="code">session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff</span> to that controller</p>
<pre class="code">
class MyController < ApplicationController
    session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff
end
</pre>
<p>Written like that, sessions are disabled for all actions on this controller.</p>
<p>Like filters, you can specify <span class="code"> <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly</span> and <span class="code">:except</span> clauses to restrict subset. The following code will disable session for <span class="code">first_action</span> and <span class="code">third_action</span>, but not for <span class="code">second_action</span>.</p>
<pre class="code">
class MyController < ApplicationController
  session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff, <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly %w(first_action third_action)

  def first_action
  end

  def second_action
  end

  def third_action
  end
end
</pre>
<p><span id="more-9"></span></p>
<p> Same could be achived with <span class="code">session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff,  :except => :second_action</span>.</p>
<p>The session options are inheritable, so to disable sessions for the entire application add <span class="code">session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff</span> to ApplicationController.</p>
<pre class="code">
class ApplicationController < ActionController::Base
    session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff
end
</pre>
<h3>session :disabled => true</h3>
<p>The downside of above approach is that if you disable sessions in ApplicationController with <span class="code">session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff</span> you can't enable them later on.</p>
<p>But luckily there is a cure for that. Instead of <span class="code">session <img src='http://kolodvor.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ff</span> add this line <span class="code">session :disabled => true</span> to ApplicationController.</p>
<pre class="code">
class ApplicationController < ActionController::Base
    session :disabled => true
end
</pre>
<p>Now, you can re-enable session support in an inheriting controller with <span class="code">session :disabled => false</span>.</p>
<pre class="code">
class MyController < ApplicationController
    session :disabled => false
end
</pre>
<h4>Further reading</h4>
<ul>
<li><a href="http://wiki.rubyonrails.org/rails/pages/HowtoChangeSessionOptions">How to Change Session Options in RoR</a></li>
<li><a href="http://wiki.rubyonrails.com/rails/pages/HowtoPerActionSessionOptions">How to Per Action Session Options in RoR</a></li>
<li><a href="http://www.quarkruby.com/2007/10/21/sessions-and-cookies-in-ruby-on-rails">QuarkRuby: Sessions and cookies in Ruby on Rails</a></li>
</ul>
<p><!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/session" rel="tag">session</a>, <a href="http://www.technorati.com/tag/rails" rel="tag">rails</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://kolodvor.net/2007/11/23/disabling-sessions-in-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kolodvor.net/2007/11/23/disabling-sessions-in-rails/</feedburner:origLink></item>
	</channel>
</rss>
