Ruby and Rails分類文章 顯示方式:簡文 | 列表

September 18,2006

September 5,2006

同一組 DB table ,不同關係的設定方式

應該很多人有類似的想法吧?
今天兩個 tables ,他們的關聯不只一種

舉個例子:
User 這個 table 跟 Email 這個 table 是 1:m 的關係
email 這個欄位有 user_id -> 代表這個信的收信人是誰
還有 sender_user_id -> 代表這個信的寄件人是誰
今天如果使用 ActiveReocrd 的預設方式

...繼續閱讀

Posted by thegiive at 樂多Roodo!8:06回應(1)引用(0)

August 25,2006

Rails 上面 Error Message 中文化

Rails 有一點設計的不夠完善
就是 i18n 的問題
當然這個問題可以用 gettext 去解決
不過 , 如果有更簡單的方式 , 也是不錯的
到目前為止
Model 裡面的 Validate Error 目前是官方無解的
所以我就從 Rails Wiki 裡面找出了不錯的解法
第一個連結
第二個連結
...繼續閱讀

Posted by thegiive at 樂多Roodo!20:04回應(0)引用(0)

August 24,2006

Rails 的詭異問題

當你在開發Rails 程式的時候
突然會發現...
疑,他不動了...
還出現

Application error

Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html


解決方式: ...繼續閱讀

Posted by thegiive at 樂多Roodo!16:24回應(0)引用(0)

August 3,2006

 [1]