Caker, Web developer,Beijing,China.

My projects

auto deploy your project

the Capistrano is greatly application ,it’s gem of Rails , wrtten by rails, but you can use it to deploy non rails project , like php . the Webbistrano is a web interface of capistrano .easy to use .
 

Tags: ,

Filed under:default

create a sticky select list

if you need a select list ,you can add the feature with options_from_collection_for_select, just pass some params to it, likes this :

<select name=”asset[asset_type_id]“>
<%= options_from_collection_for_select @asset_types, “id”, “name”,@asset.asset_type.id %>
</select>

Tags: , ,

Filed under:Uncategorized

add pagination feature to your rails app

the will_paginate is better than clasic_paginate (by default in before 2.0 ), so ,if you need the pagination feature, you can install it with svn check out
./script/plugin install \ svn://errtheblog.com/svn/plugins/will_paginate
this is a simple demo :

#view
#..views/products/list.html.erb
<h1> Products </h1>
<% for product in @products %>
<p> <%= product.name %>(<small style=”color:red;”><%= product.desc %></small>)</p>

<% end %>
<%= will_paginate @products %>

#controller
#…controller/products_controller.rb
# [...]

Tags: , ,

Filed under:Uncategorized

rails really cooooooool!

真的让人疯狂~~~~

Tags: , ,

Filed under:Uncategorized