Class: Tenon::ApplicationDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- Tenon::ApplicationDecorator
show all
- Defined in:
- app/decorators/tenon/application_decorator.rb
Instance Method Summary
collapse
Instance Method Details
#edit_path ⇒ Object
13
14
15
|
# File 'app/decorators/tenon/application_decorator.rb', line 13
def edit_path
h.url_for([:edit, object])
end
|
#path ⇒ Object
9
10
11
|
# File 'app/decorators/tenon/application_decorator.rb', line 9
def path
h.url_for(object)
end
|
#published? ⇒ Boolean
17
18
19
20
21
22
23
24
25
|
# File 'app/decorators/tenon/application_decorator.rb', line 17
def published?
if object.try(:publish_at)
object.publish_at <= Time.now
elsif object.respond_to?(:published)
object.published
else
true
end
end
|
#serializer_class ⇒ Object
5
6
7
|
# File 'app/decorators/tenon/application_decorator.rb', line 5
def serializer_class
"#{object.class}Serializer".safe_constantize
end
|