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月31日 星期一
2009年8月28日 星期五
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?
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"
execute "ALTER TABLE tou_service CHANGE service_index service_index int(11) DEFAULT NULL AUTO_INCREMENT"
訂閱:
文章 (Atom)