2009年8月31日 星期一

在model 用url_for

Calling url_for from a Model in Rails
url_for’ method – according to its Rails source code documentation – is only available to controllers, views and mailers by default. (It’s actually a method found in the ActionController module so it’s no surprise that ActiveRecord classes don’t have access to this method.)

2009年8月28日 星期五

資料流重導向
Rake in Background

daemon

Custom Daemon
Cron Jobs in Ruby on Rails

2009年8月21日 星期五

2009年8月20日 星期四

Rails Rake

Ruby on Rails Rake Tutorial (aka. How rake turned me into an alcoholic)
How do I write Rake tasks for my Rails application?


Can I access my Rails Models inside a Task?

2009年8月5日 星期三

unique, auto_increment

execute "ALTER TABLE tou_service ADD UNIQUE (service_index)"
execute "ALTER TABLE tou_service CHANGE service_index service_index int(11) DEFAULT NULL AUTO_INCREMENT"