Re: [问题] Rails route 的 prefix 字段

楼主: JokerCatz (JokerCatz)   2014-09-01 21:56:03
ccc~ 感谢,我一直以为是method_missing的实作,所以是method产生器
刚看了一下应该还是method missing类,只不过是即时generate,就不用二次字串分析
类似这种code
http://apidock.com/rails/ActionDispatch/Routing/RoutesProxy/method_missing
简单的来说初次使用还是method missing,之后产出该名method,
然后因为method missing规则是需要设定到正式的method上而非自干解决掉
就会call到你说的那边去做产生就是
&...另外的 RailsFun.tw 本身就是网址了 Orz"
※ 引述《tonytonyjan (南洋大兜虫)》之铭言:
: 我认为不是 method_missing 的用法
: # actionpack/lib/action_dispatch/routing/route_set.rb:271
: def define_named_route_methods(name, route)
: define_url_helper route, :"#{name}_path", route.defaults, name, PATH
: define_url_helper route, :"#{name}_url", route.defaults, name, FULL
: end
: 还是我误会了你的意思?
作者: tonytonyjan (南洋大兜虫)   2014-09-02 01:24:00
可以请教这段 method_missing 什么时候才会被执行吗因为我不怎么样呼叫各种 url helper,总是跑不到这段管换句话说就是 callstack 完全不会经过 routesproxy你说的档案甚至在 rails 启动时也不会被 require

Links booklink

Contact Us: admin [ a t ] ucptt.com