mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
commit
1a74447e23
2 changed files with 4 additions and 4 deletions
|
@ -196,7 +196,7 @@ Hate seeing that `h.` proxy all over? Willing to mix a bazillion methods into yo
|
|||
```ruby
|
||||
class ArticleDecorator < ApplicationDecorator
|
||||
decorates :article
|
||||
lazy_helpers
|
||||
include Draper::LazyHelpers
|
||||
|
||||
def published_at
|
||||
date = content_tag(:span, model.published_at.strftime("%A, %B %e").squeeze(" "), :class => 'date')
|
||||
|
|
|
@ -5,9 +5,9 @@ describe Draper::Base do
|
|||
subject{ Draper::Base.new(source) }
|
||||
let(:source){ Product.new }
|
||||
|
||||
context(".lazy_helpers") do
|
||||
it "makes Rails helpers available without using the h. proxy" do
|
||||
Draper::Base.lazy_helpers
|
||||
context("module LazyHelpers") do
|
||||
it "makes Rails helpers available without using the h. proxy by including it" do
|
||||
Draper::Base.send(:include, Draper::LazyHelpers)
|
||||
subject.send(:pluralize, 5, "cat").should == "5 cats"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue