<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7419224877358709855</id><updated>2011-11-27T16:18:30.353-08:00</updated><category term='ruby'/><category term='activerecord'/><category term='search engines'/><category term='global_constants'/><category term='webmin'/><category term='irb'/><category term='rubyonrails'/><category term='file_column'/><category term='restful_authentication'/><category term='attr_accessor'/><category term='console'/><category term='linux shell'/><category term='css'/><category term='rails'/><category term='script'/><category term='windows'/><category term='email'/><category term='rmagick'/><category term='vim'/><category term='active_merchant'/><category term='open-uri'/><category term='kikout'/><category term='generator'/><category term='patch'/><category term='apache'/><category term='linux'/><category term='beanstream'/><category term='uni-form'/><category term='cvs'/><category term='comatose'/><category term='variable'/><category term='mysql'/><category term='cygwin'/><category term='table_styles'/><category term='openssl'/><category term='ssh'/><category term='syntax highlighting'/><category term='fileutils'/><category term='jedit'/><category term='uni_admin'/><category term='gems'/><category term='config'/><category term='scaffold'/><category term='pagination'/><category term='rails2.0'/><category term='actionmailer'/><category term='gvim'/><category term='ssh2'/><category term='html'/><category term='mongrel'/><category term='ssl'/><category term='https'/><category term='server'/><category term='payment'/><category term='plugins'/><category term='gmail'/><category term='vista'/><category term='svn'/><title type='text'>Xiaobo On Rails</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-5772926481209778028</id><published>2008-04-13T15:20:00.000-07:00</published><updated>2008-04-13T15:47:40.628-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='variable'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='attr_accessor'/><category scheme='http://www.blogger.com/atom/ns#' term='activerecord'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Rails attr_accessor is an instance variable</title><content type='html'>It took me some time to truly understand rails attr_accessor macro method though I've already used it a lot before.&lt;br /&gt;&lt;br /&gt;Attr_accessor, along with attr_reader and attr_writer, they are in fact ruby things not rails. Attr_accessor defines instance variables and builds the get/set methods for each instance variable.&lt;br /&gt;&lt;br /&gt;To know the difference between ActiveRecord's attribute (for table field) and the attr_accessor, the best way is to give an example, let's see:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;class User &gt; ActiveRecord::Base&lt;br /&gt;    attr_accessor :password  #password is not a user's table field&lt;br /&gt;    validates_presence_of  :login&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;##########################&lt;br /&gt;&lt;br /&gt;[/home/jack/test_app]$ script/console&lt;br /&gt;Loading development environment (Rails 2.0.2)&lt;br /&gt;&gt;&gt; user = User.new(:login =&gt; "jimmy", :password =&gt; "railsrocks")&lt;br /&gt;=&gt; #&lt;user&gt;   &lt;br /&gt;### password is not a field&lt;br /&gt;&lt;br /&gt;&gt;&gt; user.instance_variables&lt;br /&gt;=&gt; ["@attributes_cache", "@attributes", "@password", "@new_record"]&lt;br /&gt;&gt;&gt; user.instance_variable_get :@login&lt;br /&gt;=&gt; nil&lt;br /&gt;&gt;&gt; user.instance_variable_get :@password&lt;br /&gt;=&gt; "railsrocks"&lt;br /&gt;&gt;&gt; user.has_attribute? "login"&lt;br /&gt;=&gt; true&lt;br /&gt;&gt;&gt; user.has_attribute? "password"&lt;br /&gt;=&gt; false&lt;br /&gt;### login is an attribute, while password is a instance variable&lt;br /&gt;&lt;br /&gt;&gt;&gt; user.login&lt;br /&gt;=&gt; "jimmy"&lt;br /&gt;&gt;&gt; user.password&lt;br /&gt;=&gt; "railsrocks"&lt;br /&gt;&gt;&gt; user.send 'login'&lt;br /&gt;=&gt; "jimmy"&lt;br /&gt;&gt;&gt; user.send 'password'&lt;br /&gt;=&gt; "railsrocks"&lt;br /&gt;### both getter/setter are working&lt;br /&gt;### in some situation, for example, the field name itself is a variable&lt;br /&gt;### you can use: user.send method_name&lt;br /&gt;&lt;br /&gt;&gt;&gt; user[:login]&lt;br /&gt;=&gt; "jimmy"&lt;br /&gt;&gt;&gt; user.attributes&lt;br /&gt;=&gt; {"login"=&gt;"jimmy"}&lt;br /&gt;&gt;&gt; user[:password]&lt;br /&gt;=&gt; nil&lt;br /&gt;### oops, I can not get password by this way&lt;br /&gt;&lt;br /&gt;&gt;&gt; user.attributes={:login =&gt; "grissom", :password =&gt; "rubyrocks"}&lt;br /&gt;=&gt; {:password=&gt;"rubyrocks", :login=&gt;"grissom"}&lt;br /&gt;&gt;&gt; user.password&lt;br /&gt;=&gt; "rubyrocks"&lt;br /&gt;### well, to assign value is working&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-5772926481209778028?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/5772926481209778028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=5772926481209778028' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/5772926481209778028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/5772926481209778028'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/04/rails-attraccessor-is-instance-variable.html' title='Rails attr_accessor is an instance variable'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-1847042916602817192</id><published>2008-04-10T15:36:00.000-07:00</published><updated>2008-04-10T15:56:12.578-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uni-form'/><category scheme='http://www.blogger.com/atom/ns#' term='restful_authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='uni_admin'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='comatose'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Design Free Administration Back Office For Rails Application</title><content type='html'>There are some common concerns to build a back office for a rails project. Not like the front pages, which are usually designed by professional web designers, back office pages often need to be scratched by programmers. It often takes me a lot of time to do the layout, HTML structures, header and footer, div content boxes, list table styles and form field styles. Though I am familiar with CSS, I still troubled a lot with the overall look and feel because of my lack of the web design gene. So I am writing here to conclude a way to be design fee....&lt;br /&gt;&lt;br /&gt;1. Install my plugin uni_admin for admin layout, table styles:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/ruby-on-rails-plugin-uni-admin/"&gt;http://code.google.com/p/ruby-on-rails-plugin-uni-admin/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Install  uni-form and my uni-form-patch for form styles&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/rails-uni-form-patch/"&gt;http://code.google.com/p/rails-uni-form-patch/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Install plugin restful authentication for basic authentication&lt;br /&gt;&lt;br /&gt;&lt;a href="http://xiaoboonrails.blogspot.com/2008/02/install-and-config-rails-plugin.html"&gt;http://xiaoboonrails.blogspot.com/2008/02/install-and-config-rails-plugin.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. If you have installed comatose, it is easy to integrate comatose_admin with uni_admin layout&lt;br /&gt;&lt;a href="http://xiaoboonrails.blogspot.com/2008/02/some-problems-of-installation-of-rails.html"&gt;&lt;/a&gt;&lt;blockquote&gt;rake comatose:admin:customize&lt;br /&gt;update related content of layouts/uni_admin_layout.html.erb to layouts/comatose_admin.rhtml&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-1847042916602817192?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/1847042916602817192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=1847042916602817192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/1847042916602817192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/1847042916602817192'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/04/design-free-administration-back-office.html' title='Design Free Administration Back Office For Rails Application'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-8208353394460022915</id><published>2008-04-10T15:21:00.001-07:00</published><updated>2008-04-10T15:29:49.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uni-form'/><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Rails Plugin Uni_Form_Patch for Plugin Uni-Form</title><content type='html'>UniFormPatch&lt;br /&gt;============&lt;br /&gt;A small patch plugin for &lt;a href="https://rubyforge.org/projects/uni-form/"&gt;Marcus Irven's uni-form plugin&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Code home: &lt;a href="http://code.google.com/p/rails-uni-form-patch/"&gt;http://code.google.com/p/rails-uni-form-patch/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Fix the following features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Make the form show properly&lt;/li&gt;&lt;li&gt;Show field focus and error background images&lt;/li&gt;&lt;li&gt;Show error and success form messages properly&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Installation&lt;br /&gt;=========&lt;br /&gt;If you havn't installed uni-form, install it at first:&lt;br /&gt;&lt;blockquote&gt;script/plugin install http://uni-form.rubyforge.org/svn/trunk/plugins/uni-form/&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Follow the installation notes in Marcus's uni-form README to finish installation&lt;br /&gt;&lt;br /&gt;Install uni_form_patch:&lt;br /&gt;&lt;blockquote&gt;script/plugin install http://rails-uni-form-patch.googlecode.com/svn/trunk/uni_form_patch&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;The installation will automatically copy/update/delete files:&lt;br /&gt;&lt;blockquote&gt;Copy public/images/uni-form/*.png&lt;br /&gt;Update public/stylesheets/uni-form.css&lt;br /&gt;Delete public/stylesheets/uni-form-generic.css&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Example&lt;br /&gt;=======&lt;br /&gt;For the usage of uni-form, read Marcus's uni-form README.&lt;br /&gt;&lt;br /&gt;Show uni-form style messages:&lt;br /&gt;&lt;blockquote&gt;&lt;% uni_form_for :user do |form| %&gt;&lt;br /&gt;&lt;br /&gt;&lt;%= uniform_success_message flash[:notice] if flash[:notice] %&gt;&lt;br /&gt;&lt;%= uniform_error_messages [@user] %&gt;&lt;br /&gt;&lt;%= uniform_error_messages [@user, @address] %&gt;&lt;br /&gt;&lt;br /&gt;&lt;% form.fieldset :type =&gt; "block", :legend =&gt; "cool stuff" do %&gt;&lt;br /&gt;    &lt;%= form.text_field :first_name, :required =&gt; true, :label =&gt; "Your first name" %&gt;&lt;br /&gt;    &lt;%= form.text_field :last_name %&gt;&lt;br /&gt;&lt;% end %&gt;&lt;br /&gt;&lt;%= form.submit "save" %&gt;&lt;br /&gt;&lt;% end %&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-8208353394460022915?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/8208353394460022915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=8208353394460022915' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8208353394460022915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8208353394460022915'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/04/rails-plugin-uniformpatch-for-plugin.html' title='Rails Plugin Uni_Form_Patch for Plugin Uni-Form'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-644308805282468413</id><published>2008-04-10T12:17:00.000-07:00</published><updated>2008-04-10T12:24:20.063-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='uni_admin'/><category scheme='http://www.blogger.com/atom/ns#' term='rails2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Ruby On Rails Plugin Uni Admin For Admin Layout</title><content type='html'>Today I code a new simple plugin Uni_Admin. Uni Admin is a simple administration layout support for ruby on rails web application. Now it includes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;an admin base controller and dashboard action&lt;/li&gt;&lt;li&gt;a simple admin layout&lt;/li&gt;&lt;li&gt;a simple admin CSS file&lt;/li&gt;&lt;li&gt;an integrated admin menu&lt;/li&gt;&lt;li&gt;a record list table style&lt;/li&gt;&lt;/ul&gt;Demo:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U22nw8TzDk0/R_5oJ_DBGJI/AAAAAAAAA78/-sFRGDxF9B0/s1600-h/demo.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 404px; height: 174px;" src="http://1.bp.blogspot.com/_U22nw8TzDk0/R_5oJ_DBGJI/AAAAAAAAA78/-sFRGDxF9B0/s400/demo.gif" alt="" id="BLOGGER_PHOTO_ID_5187698341529589906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;More details please see the code page:&lt;br /&gt;&lt;a href="http://code.google.com/p/ruby-on-rails-plugin-uni-admin/"&gt;&lt;br /&gt;http://code.google.com/p/ruby-on-rails-plugin-uni-admin/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-644308805282468413?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/644308805282468413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=644308805282468413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/644308805282468413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/644308805282468413'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/04/ruby-on-rails-plugin-uni-admin-for.html' title='Ruby On Rails Plugin Uni Admin For Admin Layout'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U22nw8TzDk0/R_5oJ_DBGJI/AAAAAAAAA78/-sFRGDxF9B0/s72-c/demo.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-74388889296840672</id><published>2008-04-09T19:46:00.001-07:00</published><updated>2008-04-09T19:58:08.506-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='search engines'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><category scheme='http://www.blogger.com/atom/ns#' term='kikout'/><title type='text'>KikOut.com Beta Version 0.2 Released</title><content type='html'>My ruby on rails project &lt;a href="http://www.kikout.com/"&gt;KikOut.com&lt;/a&gt; released beta version 0.2.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kikout.com/images/kikout_s.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 109px; height: 40px;" src="http://www.kikout.com/images/kikout_s.gif" alt="" border="0" /&gt;&lt;/a&gt;It is a search engine to help you facilitate your web searching, for example, using youtube:keyword to search youtube directly. You will dig more fun after using it. More information about Kikout please check out the &lt;a href="http://www.kikout.com/searches/howto"&gt;Kikout why&amp;amp;howto page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Welcome &lt;a href="http://www.kikout.com/searches/new"&gt;make your own search definitions&lt;/a&gt; or &lt;a href="http://www.kikout.com/comments"&gt;share your experiences/submit your comments&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-74388889296840672?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/74388889296840672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=74388889296840672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/74388889296840672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/74388889296840672'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/04/kikoutcom-beta-version-02-released.html' title='KikOut.com Beta Version 0.2 Released'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-8674662579747814131</id><published>2008-03-19T21:41:00.000-07:00</published><updated>2008-03-19T21:51:22.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='active_merchant'/><category scheme='http://www.blogger.com/atom/ns#' term='beanstream'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='payment'/><category scheme='http://www.blogger.com/atom/ns#' term='patch'/><title type='text'>Rails ActiveMerchant Patch For BeanStream</title><content type='html'>I submitted the patch to &lt;a href="http://www.activemerchant.org/"&gt;active merchant&lt;/a&gt; plugin for Canada payment gateway &lt;a href="http://www.beanstream.com/"&gt;BeanStream&lt;/a&gt;. I guess that it will take some time to get reviewed, tested and accepted ( or not accepted because the remote test can not be passed without beanstream's test account which it doesn't provide it to me), so I uploaded the patch to a google code project:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/activemerchant-patch-for-beanstream/"&gt;http://code.google.com/p/activemerchant-patch-for-beanstream/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The installation, description and a simple example have been already written in the project home page. Issue your bug or give me your feedback if you encounter any problem when using it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-8674662579747814131?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/8674662579747814131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=8674662579747814131' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8674662579747814131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8674662579747814131'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/rails-activemerchant-patch-for.html' title='Rails ActiveMerchant Patch For BeanStream'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-8499619714664415117</id><published>2008-03-19T19:34:00.000-07:00</published><updated>2008-03-19T19:45:40.315-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='table_styles'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>A Rails Plugin table_styles to let you easily use up to 42 different css styles for HTML table.</title><content type='html'>Today I wrote a rails plugin based on &lt;a href="http://icant.co.uk/csstablegallery/index.php" rel="nofollow"&gt;CSS Table Gallery&lt;/a&gt; .&lt;br /&gt;&lt;br /&gt;I upload to google code: &lt;a href="http://code.google.com/p/rails-plugin-table-styles/"&gt;http://code.google.com/p/rails-plugin-table-styles/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Installation&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;script/plugin install http://rails-plugin-table-styles.googlecode.com/svn/trunk/table_styles&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Usage&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;* Use the demo to find one of your favorable style.&lt;br /&gt;&lt;blockquote&gt;# Start your server: &gt;script/server&lt;br /&gt;# Visit http://localhost:3000/table_styles_demo/&lt;br /&gt;# Remember to add map.connect :controller/:action in your routes.rb&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;* Choose one of table styles in your layout header, use "tagbox" as an example.&lt;br /&gt;&lt;blockquote&gt;&lt;%= table_stylesheet_link_tag "tagbox" %&gt;&lt;/blockquote&gt;&lt;br /&gt;* Just use table tag it in your view&lt;br /&gt;&lt;br /&gt;* Use form helper if you want to let admin user to choose table style in user preferences page.&lt;br /&gt;&lt;blockquote&gt;table_style_select or table_style_options_for_select&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-8499619714664415117?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/8499619714664415117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=8499619714664415117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8499619714664415117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8499619714664415117'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/rails-plugin-tablestyles-to-let-you.html' title='A Rails Plugin table_styles to let you easily use up to 42 different css styles for HTML table.'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-7409500136892188858</id><published>2008-03-19T11:15:00.000-07:00</published><updated>2008-03-19T11:38:53.653-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='irb'/><category scheme='http://www.blogger.com/atom/ns#' term='console'/><title type='text'>Rails irb or script/console tips in one glimpse</title><content type='html'>Summarize most basic tips of using script/console here:&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;# script/console  (note: start it)&lt;/li&gt;&lt;li&gt;# script/console production  (note: start it with production environment)&lt;/li&gt;&lt;li&gt;# script/console -s (note: run in sandbox, all change to data records will rollback)&lt;/li&gt;&lt;li&gt;&gt;&gt;$LOAD_PATH (note: see the load_path of current environment)&lt;/li&gt;&lt;li&gt;&gt;&gt;reload! (note: reload the environment)&lt;/li&gt;&lt;li&gt;&gt;&gt;clear&lt;/li&gt;&lt;li&gt;&gt;&gt;$ (note: use TAB key to see all environment variables)&lt;/li&gt;&lt;li&gt;&gt;&gt;Str (note: use TAB key to auto complete)&lt;/li&gt;&lt;li&gt;&gt;&gt;@hello = "Hello word!" (note: define variable)&lt;/li&gt;&lt;li&gt;&gt;&gt;@hello = Object.new (note: define variable)&lt;/li&gt;&lt;li&gt;&gt;&gt;@order = Order.find(1)  (note: get an order object, order.rb should be in one of app models)&lt;/li&gt;&lt;li&gt;&gt;&gt;app.get "/articles/1234" (note: run controller by route path)&lt;/li&gt;&lt;li&gt;&gt;&gt;app.post "/login", {:login =&gt; "xiaobozz", :password =&gt; "12345"}&lt;/li&gt;&lt;li&gt;&gt;&gt;helper.image_tag "logo.gif"  (note: run any method of actionview helpers)&lt;/li&gt;&lt;li&gt;&gt;&gt;y @order (note: YAML style output)&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;The best way to get familiar with these tips is to use them now :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-7409500136892188858?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/7409500136892188858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=7409500136892188858' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7409500136892188858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7409500136892188858'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/rails-irb-or-scriptconsole-tips-in-one.html' title='Rails irb or script/console tips in one glimpse'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-4355226784871147033</id><published>2008-03-17T07:38:00.000-07:00</published><updated>2008-03-20T07:27:27.959-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='email'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><category scheme='http://www.blogger.com/atom/ns#' term='actionmailer'/><title type='text'>Rails send emails with actionmailer and gmail</title><content type='html'>The first step is to configure your rails application to work with gmail, I just copied the 2 simple steps from&lt;a href="http://www.prestonlee.com/archives/63"&gt; the Preston Lee's article&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;1. Save &lt;a href="http://pastie.caboo.se/135270"&gt;this code&lt;/a&gt; as &lt;strong&gt;&lt;em&gt;lib/smtp_tls.rb&lt;/em&gt;&lt;/strong&gt; within your rails app;&lt;br /&gt;2. Add &lt;a href="http://pastie.caboo.se/135271"&gt;this code&lt;/a&gt; &lt;strong&gt;to &lt;em&gt;config/environment.rb&lt;/em&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The second step is to learn to use actionmailer, just follow the document "&lt;a href="http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer"&gt;How to send emails with action mailer&lt;/a&gt;" to do it then you will understand how it works pretty fast.&lt;br /&gt;&lt;br /&gt;1. ruby script/generate mailer Notifier signup order_created&lt;br /&gt;2. add code to your app/models/notifier.rb, such as&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;signup&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt; &lt;span class="ident"&gt;user&lt;/span&gt; &lt;span class="punct"&gt;)&lt;/span&gt;&lt;br /&gt; &lt;span class="comment"&gt;# Email header info MUST be added here&lt;/span&gt;&lt;br /&gt; &lt;span class="ident"&gt;recipients&lt;/span&gt; &lt;span class="ident"&gt;user&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;email&lt;/span&gt;&lt;br /&gt; &lt;span class="ident"&gt;from&lt;/span&gt;  &lt;span class="punct"&gt;"&lt;/span&gt;&lt;span class="string"&gt;accounts@mywebsite.com&lt;/span&gt;&lt;span class="punct"&gt;"&lt;/span&gt;&lt;br /&gt; &lt;span class="ident"&gt;subject&lt;/span&gt; ¡°&lt;span class="constant"&gt;Thank&lt;/span&gt; &lt;span class="ident"&gt;you&lt;/span&gt; &lt;span class="keyword"&gt;for&lt;/span&gt; &lt;span class="ident"&gt;registering&lt;/span&gt; &lt;span class="ident"&gt;with&lt;/span&gt; &lt;span class="ident"&gt;our&lt;/span&gt; &lt;span class="ident"&gt;website¡±&lt;/span&gt;&lt;br /&gt; &lt;span class="comment"&gt;# Email body substitutions go here&lt;/span&gt;&lt;br /&gt; &lt;span class="ident"&gt;body&lt;/span&gt; &lt;span class="symbol"&gt;:user=&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt; &lt;span class="ident"&gt;user&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. add code to /app/views/notifier/signup.erb&lt;br /&gt;&lt;blockquote&gt;Dear &lt;%= @user.first_name %&gt; &lt;%= @user.last_name %&gt;,&lt;br /&gt;Thanks for signing up with My Website!&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;4. use the mailer in where you want.&lt;br /&gt;&lt;blockquote&gt;Notifier.deliver_signup(user)&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-4355226784871147033?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/4355226784871147033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=4355226784871147033' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4355226784871147033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4355226784871147033'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/rails-send-emails-with-actionmailer-and.html' title='Rails send emails with actionmailer and gmail'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-4416739885920657585</id><published>2008-03-12T07:46:00.001-07:00</published><updated>2008-03-12T07:48:23.861-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='webmin'/><title type='text'>How to restart Webmin</title><content type='html'>Webmin provides a stop and start command itself, while it is not in any bin path. It is in the initial installation path.&lt;br /&gt;&lt;blockquote&gt;su&lt;br /&gt;cd /usr/libexec/webmin&lt;br /&gt;webmin-init stop&lt;br /&gt;webmin-init start&lt;/blockquote&gt;&lt;br /&gt;Done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-4416739885920657585?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/4416739885920657585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=4416739885920657585' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4416739885920657585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4416739885920657585'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/how-to-restart-webmin.html' title='How to restart Webmin'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-3779176603906868048</id><published>2008-03-11T19:02:00.000-07:00</published><updated>2008-03-11T19:03:47.511-07:00</updated><title type='text'>A special post to claim on Technorati</title><content type='html'>This is a special post to claim on Technorati:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://technorati.com/claim/a9bbh4a3za" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-3779176603906868048?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/3779176603906868048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=3779176603906868048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/3779176603906868048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/3779176603906868048'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/special-post-to-claim-on-technorati.html' title='A special post to claim on Technorati'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-7233898505085020971</id><published>2008-03-11T09:54:00.000-07:00</published><updated>2008-03-11T10:38:48.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl'/><category scheme='http://www.blogger.com/atom/ns#' term='mongrel'/><category scheme='http://www.blogger.com/atom/ns#' term='https'/><category scheme='http://www.blogger.com/atom/ns#' term='openssl'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Rails Mongrel and Apache servers work with SSL, certificates and https</title><content type='html'>I am already running Apache as the front end server and Mongrel Rails Cluster Servers as the back end. To make them work with SSL, certificates and HTTPS, there are several easy steps to finish.&lt;br /&gt;&lt;br /&gt;# 1. make a directory to store ssl key and certificates&lt;br /&gt;&lt;blockquote&gt;mkdir /etc/httpd/conf/ssl&lt;/blockquote&gt;&lt;br /&gt;# 2. create openssl key and make it secure&lt;br /&gt;&lt;blockquote&gt;cd /etc/httpd/conf/ssl&lt;br /&gt;openssl genrsa -des3 -out yourdomain.key 1024&lt;br /&gt;chmod 600 yourdomain.key&lt;/blockquote&gt;&lt;br /&gt;# 3. create CSR file (certificates signing request)&lt;br /&gt;# Common name is your domain name without http:// but with www.&lt;br /&gt;&lt;blockquote&gt;openssl req -new -key yourdomain.key -out yourdomain.csr&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;# 4. I bought &lt;a href="http://www.godaddy.com/"&gt;godaddy&lt;/a&gt;'s ssl certificate&lt;br /&gt;# And got the certificate by email in 5 mins after I submitted the CSR.&lt;br /&gt;&lt;blockquote&gt;Download the CSR zip file, unzip the two certs into ssl directory&lt;/blockquote&gt;&lt;br /&gt;# 5. Config apache's yourdomain config part&lt;br /&gt;# Assuming that you have configurated yourdomain.common and yourdomain.cluster_proxy.conf properly.&lt;br /&gt;&lt;blockquote&gt;virtualhost&lt;br /&gt;ServerName www.yourdomain.com:443&lt;br /&gt;Include /etc/httpd/conf/yourdomain.common&lt;br /&gt;&lt;br /&gt;RequestHeader set X_FORWARDED_PROTO 'https'&lt;br /&gt;&lt;br /&gt;ErrorLog logs/yourdomain_ssl_errors_log&lt;br /&gt;CustomLog logs/yourdomain_ssl_log combined&lt;br /&gt;&lt;br /&gt;SSLEngine on&lt;br /&gt;SSLCertificateFile /etc/httpd/conf/ssl/yourdomain.crt&lt;br /&gt;SSLCertificateKeyFile /etc/httpd/conf/ssl/yourdomain.key&lt;br /&gt;SSLCertificateChainFile /etc/httpd/conf/ssl/gd_intermediate_bundle.crt&lt;br /&gt;SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown&lt;br /&gt;/virtualhost&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;# 6. install and use plugin ssl_requirement&lt;br /&gt;&lt;blockquote&gt;script/plugin install ssl_requirement&lt;br /&gt;include SslRequirement (in your application.rb)&lt;br /&gt;ssl_required  :login, :orders  (in your controller with those actions)&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-7233898505085020971?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/7233898505085020971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=7233898505085020971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7233898505085020971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7233898505085020971'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/rails-mongrel-and-apache-servers-work.html' title='Rails Mongrel and Apache servers work with SSL, certificates and https'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-7753012335609608015</id><published>2008-03-01T09:21:00.000-08:00</published><updated>2008-03-01T09:35:16.944-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server'/><category scheme='http://www.blogger.com/atom/ns#' term='cvs'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Fast install SVN server on linux</title><content type='html'>It is crazy easy to build SVN server, much easier than CVS server. Just do the following steps:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;su root&lt;/li&gt;&lt;li&gt;# download the relatest stable version of SVN source code&lt;/li&gt;&lt;li&gt;wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz  &lt;/li&gt;&lt;li&gt;tar xzvf subversion-1.4.6.tar.gz&lt;/li&gt;&lt;li&gt;cd subversion-1.4.6&lt;/li&gt;&lt;li&gt;./configure&lt;/li&gt;&lt;li&gt;make &amp;amp; make install&lt;/li&gt;&lt;li&gt;svnserver --version # check the installation result&lt;/li&gt;&lt;li&gt;svnadmin create /svnrepos&lt;/li&gt;&lt;li&gt;vi /svnrepos/conf/svnserve.conf&lt;/li&gt;&lt;li&gt;# uncomment and edit in this config file&lt;/li&gt;&lt;li&gt;anon-access = none&lt;/li&gt;&lt;li&gt;auth-access = write&lt;/li&gt;&lt;li&gt;password-db = passwd&lt;/li&gt;&lt;li&gt;# add your username and password&lt;/li&gt;&lt;li&gt;vi /svnrepos/conf/passwd&lt;/li&gt;&lt;li&gt;# start server as a daemon&lt;/li&gt;&lt;li&gt;svnserve -d&lt;/li&gt;&lt;li&gt;# use it like:&lt;/li&gt;&lt;li&gt;svn co svn://server_ip_address/svnrepos/myproject&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://www.tonyspencer.com/2007/03/02/setup-a-subversion-server-in-4-minutes/"&gt;Setup a Subversion Server in 4 Minutes&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-7753012335609608015?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/7753012335609608015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=7753012335609608015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7753012335609608015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7753012335609608015'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/03/fast-build-svn-server-on-linux.html' title='Fast install SVN server on linux'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-647123143391906856</id><published>2008-02-26T19:28:00.000-08:00</published><updated>2008-03-20T07:51:53.181-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='global_constants'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><category scheme='http://www.blogger.com/atom/ns#' term='config'/><title type='text'>The way to have global constants in rails application</title><content type='html'>I don't know if there is a better or formal way to keep global constants for rails application. If I want to the global constants to be used only by controllers and views, the best way is to declared them in application helper. If active record is also to use them, I have to put the definitions in environment.rb. Like the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;# Global constant for this application&lt;br /&gt;# I define an array here&lt;br /&gt;SOME_GLOBAL_INSTANT = [100, 300, 500, 800, 1000]&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I googled by "rails global constants" but get no better solutions. Anyone knows this please tell me.&lt;br /&gt;&lt;br /&gt;Another way to load config into controllers is to use YAML file, check out this blog post:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://snippets.dzone.com/posts/show/287"&gt;http://snippets.dzone.com/posts/show/287&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-647123143391906856?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/647123143391906856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=647123143391906856' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/647123143391906856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/647123143391906856'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/way-to-have-global-constants-in-rails.html' title='The way to have global constants in rails application'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-4651244773983300298</id><published>2008-02-26T07:01:00.000-08:00</published><updated>2008-02-26T07:16:44.508-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><category scheme='http://www.blogger.com/atom/ns#' term='pagination'/><title type='text'>3 easy steps to do Rails 2.0 pagination</title><content type='html'>Forget about the kind of awkward pagination of rails 1.x, now you need 3 easy steps to do Rails 2.0 pagination.&lt;br /&gt;&lt;br /&gt;1. Install the pagination plugin:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ruby script/plugin install svn://errtheblog.com/svn/plugins/will_paginate&lt;/blockquote&gt;&lt;br /&gt;2. Type the following in your controller:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;@products = Product.paginate(:page =&gt; params[:page], :per_page =&gt; 25)&lt;/blockquote&gt;&lt;br /&gt;3. Type the following in your view:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;%= will_paginate @products %&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;The better thing comparing to rails 1.x pagination is that it is now easier to understand and remember. Isn't it more conventional?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-4651244773983300298?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/4651244773983300298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=4651244773983300298' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4651244773983300298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4651244773983300298'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/3-easy-steps-to-do-rails-20-pagination.html' title='3 easy steps to do Rails 2.0 pagination'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-3235035772812231499</id><published>2008-02-25T16:10:00.000-08:00</published><updated>2008-02-26T06:29:13.303-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='fileutils'/><category scheme='http://www.blogger.com/atom/ns#' term='open-uri'/><category scheme='http://www.blogger.com/atom/ns#' term='script'/><category scheme='http://www.blogger.com/atom/ns#' term='rmagick'/><title type='text'>A local Ruby script example with fileutils, open-uri, rmagick and mysql</title><content type='html'>##################################&lt;br /&gt;# a code example for writing a ruby script to be running locally&lt;br /&gt;# to do some regular local jobs such as:&lt;br /&gt;# 1, download files or images from Internet&lt;br /&gt;# 2, local file operations like mkdir, cp and remove&lt;br /&gt;# 3, access or store data into local database like mysql&lt;br /&gt;# 4, image resizing or cropping using image-magick&lt;br /&gt;##################################&lt;br /&gt;&lt;blockquote&gt;require 'open-uri'&lt;br /&gt;require 'fileutils'&lt;br /&gt;require 'RMagick'&lt;br /&gt;require 'mysql'&lt;br /&gt;&lt;br /&gt;# init local directories&lt;br /&gt;FileUtils.mkdir_p "original/montreal"&lt;br /&gt;FileUtils.mkdir_p "thumbnailed/montreal"&lt;br /&gt;&lt;br /&gt;# init the database access&lt;br /&gt;db = Mysql::new('127.0.0.1', 'root', '12345', 'test')&lt;br /&gt;&lt;br /&gt;# init links to Internet&lt;br /&gt;base_url = "http://farm1.static.flickr.com/"&lt;br /&gt;image_urls = ['40/123180238_552597a079_b.jpg',&lt;br /&gt;'146/390735501_54f0b2e826_b.jpg',&lt;br /&gt;'50/131278273_4ce6400bfa_b.jpg']&lt;br /&gt;&lt;br /&gt;# create a table to store image names&lt;br /&gt;db.query("DROP TABLE IF EXISTS images")&lt;br /&gt;db.query("CREATE TABLE images (name VARCHAR(64))")&lt;br /&gt;image_urls.each do |image|&lt;br /&gt;db.query("INSERT INTO images (name) VALUES ('#{image}')")&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# download images from Internet&lt;br /&gt;for i in 0..2&lt;br /&gt;open("original/montreal/#{i}.jpg", 'wb').write(open("#{base_url}#{image_urls[i]}").read)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# resize and crop images&lt;br /&gt;for i in 0..2&lt;br /&gt;image = Magick::Image.read("original/montreal/#{i}.jpg").first&lt;br /&gt;image.crop_resized!(150, 150, Magick::NorthGravity)&lt;br /&gt;image.write("thumbnailed/montreal/#{i}.jpg")&lt;br /&gt;end&lt;br /&gt;&lt;/blockquote&gt;References:&lt;br /&gt;&lt;br /&gt;Ruby MySQL: &lt;a href="http://www.tmtm.org/en/mysql/ruby/"&gt;http://www.tmtm.org/en/mysql/ruby/&lt;/a&gt;&lt;br /&gt;RMagick: &lt;a href="http://rmagick.rubyforge.org/resizing-methods.html"&gt;Making thumbnails with RMagick&lt;/a&gt;&lt;br /&gt;FileUtils: &lt;a href="http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html"&gt;http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html&lt;/a&gt;&lt;br /&gt;Ruby OpenURI: &lt;a href="http://www.ruby-doc.org/core/classes/OpenURI.html"&gt;http://www.ruby-doc.org/core/classes/OpenURI.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-3235035772812231499?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/3235035772812231499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=3235035772812231499' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/3235035772812231499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/3235035772812231499'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/local-ruby-script-example-with.html' title='A local Ruby script example with fileutils, open-uri, rmagick and mysql'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-8828559677737239843</id><published>2008-02-25T08:10:00.000-08:00</published><updated>2008-02-25T10:12:11.807-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='file_column'/><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><category scheme='http://www.blogger.com/atom/ns#' term='rmagick'/><title type='text'>Basic flow to use rails file_column plugin</title><content type='html'>1. Create your table with a string field to store file name. For example:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;create_table :products do |t|&lt;br /&gt; t.string   "name"&lt;br /&gt; t.string   "model"&lt;br /&gt; t.string   "image"&lt;br /&gt;      t.timestamps&lt;br /&gt;end&lt;/blockquote&gt;&lt;br /&gt;2. Install file_column plugin:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;script/plugin install http://opensvn.csie.org/rails_file_column/plugins/file_column/trunk&lt;/blockquote&gt;&lt;br /&gt;3. Install ImageMagick to your system and plugin RMagick&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Visit &lt;a href="http://rmagick.rubyforge.org/"&gt;http://rmagick.rubyforge.org/&lt;/a&gt; for more detail&lt;/blockquote&gt;&lt;br /&gt;4. Put file_column description for model field into your model code. For example here, add to product.rb:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;file_column :image, :magick =&gt; {&lt;br /&gt; :versions =&gt; { "thumb" =&gt; "60x60", "medium" =&gt; "320x240"}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;5. Generate controller and views for your model. I use rails 2.0 scaffold generator here:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;script/generate scaffold product --skip-migration&lt;br /&gt;add layout and authentication before_filter to product controller if needed&lt;br /&gt;add _form.html.erb with form fields for new.html.erb and edit.html.erb to use&lt;br /&gt;edit index.html.erb to show the list of products, such as &lt;%= f.text_field :name %&gt;&lt;/blockquote&gt;&lt;br /&gt;6. Show and upload image of product, edit in the _form.html.erb:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;remove &lt;%= f.text_field :image %&gt;&lt;br /&gt;add:&lt;br /&gt;&lt;% if !@product.id.nil? # in the case of edit %&gt;&lt;br /&gt; &lt;%= image_tag url_for_file_column("product", "image", "medium") %&gt;&lt;br /&gt;&lt;% end %&gt;&lt;br /&gt;&lt;%= file_column_field "product", "image" %&gt;&lt;/blockquote&gt;&lt;br /&gt;7. Add multipart to form tag in the edit and new files.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;% form_for(@product, :html =&gt; {:multipart =&gt; true}) do |f| %&gt;&lt;/blockquote&gt;&lt;br /&gt;8. To show image in the list:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;% @product = product %&gt;&lt;br /&gt;&lt;%= image_tag url_for_file_column("product", "image", "thumb") %&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-8828559677737239843?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/8828559677737239843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=8828559677737239843' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8828559677737239843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8828559677737239843'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/basic-flow-to-use-rails-filecolumn.html' title='Basic flow to use rails file_column plugin'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-7757908873661664577</id><published>2008-02-24T18:17:00.000-08:00</published><updated>2008-02-24T19:36:15.742-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='scaffold'/><category scheme='http://www.blogger.com/atom/ns#' term='rails2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><category scheme='http://www.blogger.com/atom/ns#' term='generator'/><title type='text'>Tips to use scaffold generator of rails 2.0</title><content type='html'>There are big differences for the scaffold between rails 2.0 and rails &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=rails+2.0+scaffold+&amp;amp;btnG=Search"&gt;rails 2.0 scaffold&lt;/a&gt;", like me, you can find a lot of good blogs or articles to learn about the new ways to use rails 2.0 scaffold. Anyhow, I would like to add some basic tips here, which I used a lot.&lt;br /&gt;&lt;br /&gt;Number one tip is to use the help from rails itself:&lt;br /&gt;&lt;blockquote&gt; script/generate scaffold -h&lt;/blockquote&gt;&lt;br /&gt;In rails 1.x, I created model and table in db firstly then do the scaffold, now the generator can do the model and table in the same time. The way to keep your old habit is to use:&lt;br /&gt;&lt;blockquote&gt;&gt; script/generate scaffold category(or other model name) --skip-migration&lt;/blockquote&gt;&lt;br /&gt;In the views, I need add the _form.html.erb by myself.&lt;br /&gt;&lt;br /&gt;The generator will also put a map.resources in your routes.rb. If I want to add new actions such as batch_new and batch_create into this categories_controller. Config the routes.rb:&lt;br /&gt;&lt;blockquote&gt;map.resources :categories,&lt;br /&gt;:collection =&gt; {:batch_new =&gt; :get, :batch_create =&gt; :post}&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-7757908873661664577?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/7757908873661664577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=7757908873661664577' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7757908873661664577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7757908873661664577'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/tips-to-use-scaffold-generator-of-rails.html' title='Tips to use scaffold generator of rails 2.0'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-6663783378789901096</id><published>2008-02-20T16:11:00.000-08:00</published><updated>2008-02-20T16:16:10.919-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Rails 2.0 tip: Create a new application with MySQL support</title><content type='html'>In rails &lt; 2.0, when I create a rails new application by the rails command, the configuration of database.yml supports MySQL by default. While in rails 2.0, it will generate default configuration database.yml for Sqlite3. To make it default as MySQL, run with -d mysql.&lt;br /&gt;&lt;blockquote&gt;rails -d mysql your_application_name&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-6663783378789901096?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/6663783378789901096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=6663783378789901096' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/6663783378789901096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/6663783378789901096'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/rails-20-tip-create-new-application.html' title='Rails 2.0 tip: Create a new application with MySQL support'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-7974011032401810980</id><published>2008-02-14T07:17:00.000-08:00</published><updated>2008-02-14T07:55:13.317-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='restful_authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='comatose'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Install and config rails plugin restful_authentication</title><content type='html'>Ruby on rails plugin Restful_authentication is a basic plugin useful for most of rails applications. It is very easy to intall and config it:&lt;br /&gt;&lt;blockquote&gt;script/plugin source http://svn.techno-weenie.net/projects/plugins&lt;br /&gt;script/plugin install restful_authentication&lt;br /&gt;script/generate authenticated user sessions&lt;br /&gt;rake db:migrate&lt;/blockquote&gt;&lt;br /&gt;Check the code in your routes.rb which is automatically added by the generation&lt;br /&gt;&lt;blockquote&gt;map.resources :users&lt;br /&gt;map.resource :session&lt;/blockquote&gt;&lt;br /&gt;Add more route mapping if your want&lt;br /&gt;&lt;blockquote&gt;map.signup '/signup', :controller =&gt; 'users', :action =&gt; 'new'&lt;br /&gt;map.login '/login', :controller =&gt; 'sessions', :action =&gt; 'new'&lt;br /&gt;map.logout '/logout', :controller =&gt; 'sessions', :action =&gt; 'destroy'&lt;/blockquote&gt;&lt;br /&gt;Visit &lt;a href="http://localhost:3000/users/new"&gt;http://localhost:3000/users/new&lt;/a&gt; or &lt;a href="http://localhost:3000/signup"&gt;http://localhost:3000/signup&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Then to make it work with Comatose, add comatose config to evironment.rb of your app:&lt;br /&gt;&lt;blockquote&gt;Comatose.configure do |config|&lt;br /&gt;  # Includes AuthenticationSystem in the ComatoseAdminController&lt;br /&gt;  config.admin_includes &lt;&lt; :authenticated_system&lt;br /&gt;&lt;br /&gt;  # Calls :login_required as a before_filter&lt;br /&gt;  config.admin_authorization = :login_required&lt;br /&gt;end&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-7974011032401810980?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/7974011032401810980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=7974011032401810980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7974011032401810980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/7974011032401810980'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/install-and-config-rails-plugin.html' title='Install and config rails plugin restful_authentication'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-4061357814759699087</id><published>2008-02-07T14:17:00.000-08:00</published><updated>2008-02-14T07:33:27.215-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='comatose'/><category scheme='http://www.blogger.com/atom/ns#' term='rubyonrails'/><title type='text'>Some problems of the installation of Rails Comatose Plugin</title><content type='html'>&lt;a href="http://comatose.rubyforge.org/index.html"&gt;Comatose&lt;/a&gt; is a very handy content management ruby on rails plugin. Here I am listing some problems that I encountered when I get Comatose running correctly. Most of them can be easily fixed by googling. It is just a quick summary just in case you get the same kinds of problems or errors as I did.&lt;br /&gt;&lt;br /&gt;To install it:&lt;br /&gt;&lt;blockquote&gt;script/plugin install http://comatose-plugin.googlecode.com/svn/trunk/comatose&lt;br /&gt;script/generate comatose_migration&lt;br /&gt;rake db:migrate&lt;br /&gt;# add to your routes.rb:&lt;br /&gt;map.comatose_admin&lt;br /&gt;map.comatose_root 'pages'&lt;br /&gt;script/server&lt;br /&gt;# visit content admin http://localhost:3000/comatose_admin&lt;br /&gt;# after add a page of name My Page&lt;br /&gt;# visit it at http://localhost:3000/pages/my-page&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;1. Do rake db migration, get a Mysql::Error: BLOB/TEXT column 'full_path' can't have a default value. To fix it, remove ":default =&gt; ''" from the definition of column 'full_path', in the migration file db/migrate/xxx_add_comatose_support.rb&lt;br /&gt;&lt;br /&gt;2. To start your rails app, get an error `method_missing': undefined method `comatose_admin' for #&lt;actioncontroller::routing::routeset::mapper:0x7f315964&gt;. I got this routing error after I use Active Merchant plugin, can not figure out why. Add this to environment.rb to  make Comatose plugin  be loaded firstly:&lt;br /&gt;&lt;/actioncontroller::routing::routeset::mapper:0x7f315964&gt;&lt;blockquote&gt;config.plugins = [ :comatose, :all ]&lt;/blockquote&gt;&lt;br /&gt;3. Install necessary plugins&lt;br /&gt;&lt;blockquote&gt;./script/plugin install acts_as_tree&lt;br /&gt;./script/plugin install acts_as_list&lt;/blockquote&gt;&lt;br /&gt;4. To customize comatose admin view&lt;br /&gt;&lt;blockquote&gt;rake comatose:admin:customize&lt;/blockquote&gt;&lt;br /&gt;This task will copy all of admin view rthml files to app/view/comatose_admin directory of your rails app. There is a new layout file comatose_admin.rhtml. Modify this layout file to customize your admin view.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-4061357814759699087?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/4061357814759699087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=4061357814759699087' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4061357814759699087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/4061357814759699087'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/some-problems-of-installation-of-rails.html' title='Some problems of the installation of Rails Comatose Plugin'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-6929501802715983961</id><published>2008-02-04T11:35:00.000-08:00</published><updated>2008-02-04T12:00:37.648-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh2'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><title type='text'>Auto ssh login from Cygwin to linux server</title><content type='html'>I have a ssh2 client software installed before the installation of cygwin, but I never tried the auto login by public key successfully, one reason, I guess, is that my remote server doesn't have SSH2 server installed. Now that I am using cygwin, i install the &lt;span style="font-weight: bold;"&gt;openssh &lt;/span&gt;(not openssl) module from cygwin installation packages.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;[cygwin:~/] ssh-keygen -t rsa  (leave passphrase empty to make ssh-login easier)&lt;br /&gt;[cygwin:~/] cd .ssh&lt;br /&gt;[cygwin:~/] scp id_rsa.pub username@remote_host:.ssh/ (enter password this time)&lt;br /&gt;[cygwin:~/] ssh username@remote_host (enter password this time)&lt;br /&gt;[remote_host:~/] cd .ssh (create one if not existed)&lt;br /&gt;[remote_host:~/] touch authorized_keys (create this file is not existed)&lt;br /&gt;[remote_host:~/] cat id_rsa.pub &gt;&gt; authorized_keys&lt;br /&gt;[remote_host:~/] rm -f id_rsa.pub&lt;br /&gt;[remote_host:~/] chmod 600 authorized_keys&lt;br /&gt;[remote_host:~/] cd ..&lt;br /&gt;[remote_host:~/] chmod 700 .ssh&lt;br /&gt;[remote_host:~/] exit&lt;br /&gt;[cygwin:~/] ssh username@remote_host&lt;br /&gt;[========== no password anymore, also for scp ===========]&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-6929501802715983961?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/6929501802715983961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=6929501802715983961' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/6929501802715983961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/6929501802715983961'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/auto-ssh-login-from-cygwin-to-linux.html' title='Auto ssh login from Cygwin to linux server'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-8345948628533232946</id><published>2008-02-02T13:21:00.001-08:00</published><updated>2008-02-04T10:33:28.370-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='gems'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><category scheme='http://www.blogger.com/atom/ns#' term='rmagick'/><title type='text'>Run Ruby, Gems, Rails, MySQL and RMagick on Cygwin</title><content type='html'>Before using cygwin, I did not expect that the commands of rails do not work in cygwin. To make ruby, gems and rails to work, there are some additional tasks to do as following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;Add devel -&gt; &lt;span style="font-weight: bold;"&gt;make + ruby + gcc + subversion&lt;/span&gt; modules from cygwin installation&lt;/li&gt;&lt;li&gt;Download gems tgz install package from &lt;a href="http://rubyforge.org/frs/?group_id=126"&gt;Ruby Gems download home&lt;/a&gt;&lt;/li&gt;&lt;li&gt;tar xzvf rubygems-1.0.x.tgz&lt;/li&gt;&lt;li&gt;cd rubygems-1.0.x&lt;/li&gt;&lt;li&gt;unset RUBYOPT (before install gems, clear RUBYOPT=rubygems)&lt;/li&gt;&lt;li&gt;ruby setup.rb&lt;/li&gt;&lt;li&gt;gem install rails --include-dependencies&lt;/li&gt;&lt;li&gt;Download mysql source tar.gz file from &lt;a href="http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz/from/http://ftp.astral.ro/mirrors/mysql.com/"&gt;MySQL download page&lt;/a&gt;&lt;/li&gt;&lt;li&gt;tar xzvf mysql-5.0.45.tar.gz&lt;/li&gt;&lt;li&gt;cd mysql-5.0.45&lt;/li&gt;&lt;li&gt;./configure&lt;/li&gt;&lt;li&gt;make install ( or to do it faster, just make install under sub directories libmysql and include.&lt;/li&gt;&lt;li&gt;gem install mysql&lt;/li&gt;&lt;li&gt;Change the database server from localhost to 127.0.0.1 in the database.yml of your rails app&lt;/li&gt;&lt;li&gt;Install &lt;span style="font-weight: bold;"&gt;ImageMagick,  libmagick-devel, XFree86-lib-compat, xorg-x11-devel, libbz2-devel&lt;/span&gt; module from cygwin installation file&lt;/li&gt;&lt;li&gt;gem install RMagick&lt;br /&gt;&lt;/li&gt;&lt;li&gt;ruby script/server.  voila!&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;Labnotes: &lt;a href="http://blog.labnotes.org/2005/11/06/setting-up-ruby-gems-on-cygwin/"&gt;Setting up Ruby + Gems on Cygwin&lt;/a&gt;&lt;br /&gt;Softpedia: &lt;a href="http://news.softpedia.com/news/Install-Rails-on-Windows-using-Cygwin-63477.shtml"&gt;Install Rails on Windows with cygwin&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-8345948628533232946?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/8345948628533232946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=8345948628533232946' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8345948628533232946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/8345948628533232946'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/run-ruby-gems-rails-and-mysql-on-cygwin.html' title='Run Ruby, Gems, Rails, MySQL and RMagick on Cygwin'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-5415095933762067590</id><published>2008-02-02T11:13:00.000-08:00</published><updated>2008-02-03T14:41:25.824-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><title type='text'>Vim of Cygwin to Set default file format</title><content type='html'>If create a bash file under cygwin using vim, the default configuration of vim stores the bash file in the format of dos, therefore the bash file can not execute correctly.&lt;br /&gt;&lt;br /&gt;To store the currently editting file in the format of unix:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;:set fileformat (or ff)=unix&lt;/blockquote&gt;&lt;br /&gt;If I want to change the default file format of vim to unix, add this code into the .vimrc and .gvimrc file under my home directory:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;set fileformats=unix,dos&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-5415095933762067590?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/5415095933762067590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=5415095933762067590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/5415095933762067590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/5415095933762067590'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/02/vim-of-cygwin-to-set-default-file.html' title='Vim of Cygwin to Set default file format'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-1604243152096038743</id><published>2008-01-31T12:36:00.000-08:00</published><updated>2008-01-31T18:58:40.953-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vista'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='linux shell'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><category scheme='http://www.blogger.com/atom/ns#' term='gvim'/><title type='text'>Install Cygwin, Linux Commands and GVim with Windows Vista</title><content type='html'>&lt;ul&gt;&lt;li&gt;Download the "setup.exe" program from Cygwin (&lt;a href="http://www.cygwin.com/setup.exe"&gt;http://www.cygwin.com/setup.exe&lt;/a&gt;) then install it.&lt;/li&gt;&lt;li&gt;At the time of installing cygwin, select modules to install as you wish, such as cron, zip, unzip, shutdown, wget, openssh, perl.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download the self-installing-on-windows executable GVim program from vim online (&lt;a href="ftp://ftp.vim.org/pub/vim/pc/gvim71.exe"&gt;ftp://ftp.vim.org/pub/vim/pc/gvim71.exe&lt;/a&gt;) then install it.&lt;/li&gt;&lt;li&gt;Put vim installation path into the windows environment variable "PATH".&lt;/li&gt;&lt;li&gt;To set the colorscheme of GVim, create a .gvimrc file into home directory, say c:\Users\your_user_name\ with a line "colorscheme your_scheme", my favorite is murphy.&lt;/li&gt;&lt;li&gt;Open cygwin program, click "Properties" on the left top menu to set cygwin with your favorite color scheme and font.&lt;/li&gt;&lt;li&gt;To improve bash of cygwin, put a .bashrc file into home directory, but there are two tricks. Firstly cygwin may somehow ignore the .bashrc (I don't know why), the solution to this problem is to put an executable string in the bottom of /etc/profile:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;. "$HOME/.bashrc"&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Secondly if the format of .bashrc is pc not unix, this file may not be executed correctly. I use EditPlus to transfer the format to unix.&lt;/li&gt;&lt;li&gt;My .bashrc file is like this:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;##################################################&lt;br /&gt;# .bashrc file&lt;br /&gt;##################################################&lt;br /&gt;# PATH&lt;br /&gt;#=================================================&lt;br /&gt;# Add "." and "~/bin" to PATH varible:&lt;br /&gt;# export PATH=.:/home/user_name/bin:`printenv PATH`&lt;br /&gt;&lt;br /&gt;# Aliases&lt;br /&gt;#=================================================&lt;br /&gt;alias more=less&lt;br /&gt;alias up='cd ..'&lt;br /&gt;alias ll='ls -la'&lt;br /&gt;alias ls='ls -F'&lt;br /&gt;alias ps='ps -Wl'&lt;br /&gt;alias home='cd $HOME'&lt;br /&gt;alias which='type -path'&lt;br /&gt;alias unix2dos='recode lat1:ibmpc'&lt;br /&gt;alias dos2unix='recode ibmpc:lat1'&lt;br /&gt;alias h='history 30'&lt;br /&gt;alias rmf='rm -Rf'&lt;br /&gt;alias v='vim'&lt;br /&gt;alias su='su -'&lt;br /&gt;alias tails='tail -f -n 100'&lt;br /&gt;&lt;br /&gt;# Shell Prompt customization (cygwin or unix version)&lt;br /&gt;#=================================================&lt;br /&gt;export PS1="\n[xb@dell:\w]\$ "&lt;br /&gt;&lt;br /&gt;##################################################&lt;br /&gt;# END .bashrc&lt;br /&gt;##################################################&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Use SSH ssh-keygen2 to generate public and private keys, scp public key to remote server's .ssh directory, cat public key to authorized_keys. Open file hosts at C:\Windows\System32\drivers\etc to add the ip address and a brief hostname for your remote server. Use ssh username@remote_hostname to login in the future.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-1604243152096038743?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/1604243152096038743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=1604243152096038743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/1604243152096038743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/1604243152096038743'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/01/install-cygwin-linux-commands-and-gvim.html' title='Install Cygwin, Linux Commands and GVim with Windows Vista'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7419224877358709855.post-292777514666975952</id><published>2008-01-31T11:52:00.000-08:00</published><updated>2008-02-03T15:00:49.223-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='jedit'/><category scheme='http://www.blogger.com/atom/ns#' term='syntax highlighting'/><title type='text'>JEdit Syntax Highlighting For Rails 2.0</title><content type='html'>&lt;p&gt;&lt;a href="http://wshaddix.wordpress.com/2007/12/17/updating-jedit-syntax-highlighting-for-rails-201/"&gt;A good and easy tip&lt;/a&gt; from Wes Shaddix to update JEdit syntax highlighting for rails 2.0 html.erb file:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Utilities =&gt; Global Options&lt;/li&gt;&lt;li&gt;Select “Editing”&lt;/li&gt;&lt;li&gt;In the “Change Settings For Mode” dropdown select RHTML&lt;/li&gt;&lt;li&gt;Unselect the “Use default settings” checkbox&lt;/li&gt;&lt;li&gt;Update the File name glob: setting to “*.{rhtml,html.erb}”&lt;/li&gt;&lt;li&gt;Apply and reload your html.erb file, syntax highlighting is back!&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Thanks Wes Shaddix!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7419224877358709855-292777514666975952?l=xiaoboonrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xiaoboonrails.blogspot.com/feeds/292777514666975952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7419224877358709855&amp;postID=292777514666975952' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/292777514666975952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7419224877358709855/posts/default/292777514666975952'/><link rel='alternate' type='text/html' href='http://xiaoboonrails.blogspot.com/2008/01/jedit-syntax-highlighting-for-rails-20.html' title='JEdit Syntax Highlighting For Rails 2.0'/><author><name>xiaobozz</name><uri>http://www.blogger.com/profile/16186658461111693141</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://bp3.blogger.com/_U22nw8TzDk0/R6IYX-zowMI/AAAAAAAAA2E/xoKcsmy0_QA/S220/IMG_1795_s.jpg'/></author><thr:total>3</thr:total></entry></feed>
