Rails 希望为每个 controller 都增加一个 export action

sforce100 · December 14, 2012 · Last by simlegate replied at December 16, 2012 · 2442 hits

routes 可以一个个指定。。但是,是不是有办法不一个个指定呢

Rails 4 有这个功能

match '/:controller/export'

#1 楼 @huacnlee 你 Rails4 都看了哇?

#3 楼 @simlegate 还没时间卡哇。。。不过想了个方法。。把这些 action 都放到同一个 controller 里面。。感觉更好

加在 ApplicationController

#6 楼 @simlegate 和以前一样,加在 ApplicationController 就相当与加在每个 Controller 里面

#8 楼 @knwang 相当于继承是不?

#10 楼 @knwang 要不要设为 private?

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