Rails controller 的命名问题

nanzhang · August 23, 2012 · Last by huacnlee replied at August 23, 2012 · 2926 hits

创建 controller:

rails g controller  ***::import_users_from_csv
rake routes:
import_users_from_csv_index  GET   /admin/content/import_users_from_csv(.:format)    magic_content/import_users_from_csv#index 

但一般的是:

import_users GET    /admin/content/import_users(.:format)

访问 .../.../import_users_from_csv

No route matches {:action=>"show", :controller=>"magic_content/import_users_from_csv"}

由此就访问 show 的 action.

rails 的 controller 命名是不是最多支持 2 个单词?这算是一个 BUG 吗?求解!!

You need to Sign in before reply, if you don't have an account, please Sign up first.