【问题标题】:Inherited Resources and Draper继承的资源和 Draper
【发布时间】:2013-02-15 11:53:34
【问题描述】:

DraperInherited Resources 怎么用?

也就是说,如何为每个资源调用方法(#decorate)?例如@posts 对应#index@post 对应#show

我想到了default_scope,但与 Draper 相关的所有内容都需要在控制器中,而不是在模型中,恕我直言。

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 inherited-resources draper


    【解决方案1】:

    您可以在 Draper 的 Github 中查看此讨论:

    https://github.com/drapergem/draper/issues/99

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多