Skip to content

Instantly share code, notes, and snippets.

@ilake
Created March 10, 2010 02:37
Show Gist options
  • Save ilake/327443 to your computer and use it in GitHub Desktop.
Save ilake/327443 to your computer and use it in GitHub Desktop.
在restful的前提下, 遇到class的to_param是字串, 而剛好某筆
紀錄的to_param欄位含有.
一般情形下會發生錯誤, 因為restful會把.後的東西當成format
這時的解法, 變成要在routes.rb中的xxx.resources加上參數
ex:
map.resources :categories, :requirements => {:id => /.*/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment