Skip to content

Instantly share code, notes, and snippets.

@znz
Created September 21, 2012 06:19
Show Gist options
  • Save znz/3759997 to your computer and use it in GitHub Desktop.
Save znz/3759997 to your computer and use it in GitHub Desktop.
draper と active_decorator について調べたことのメモ

rails decorator memo

gemdraperactive_decorator
参考URLRailscast #286Rails3レシピブック外伝 recipe 10
反映タイミングHogeDecorator 使用時view_assigns 時
関連対応decorates_associationpartial render 時

参考:

draper (0.17.0) も active_decorator (0.3.3) も「rails g decorator Foo::Bar」で spec/decorators/bar_decorator_spec.rb が作成された。 (app の方は draper が app/decorators/foo/bar_decorator.rb で active_decorator が app/decorators/bar_decorator.rb だった。)

issues に報告済み

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment