Class: Tenon::ApplicationDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- Tenon::ApplicationDecorator
show all
- Defined in:
- app/decorators/tenon/application_decorator.rb
Direct Known Subclasses
AssetDecorator, CommentDecorator, ContactDecorator, EventDecorator, GalleryDecorator, PageDecorator, PostCategoryDecorator, PostDecorator, RedirectDecorator, TenonCalloutDecorator, TenonContent::RowDecorator, UserDecorator
Instance Method Summary
collapse
Instance Method Details
#delete_link(opts = {}) ⇒ Object
17
18
19
|
# File 'app/decorators/tenon/application_decorator.rb', line 17
def delete_link(opts = {})
h.delete_link(object, opts)
end
|
#edit_link(opts = {}) ⇒ Object
13
14
15
|
# File 'app/decorators/tenon/application_decorator.rb', line 13
def edit_link(opts = {})
h.edit_link(object, opts)
end
|
#edit_path ⇒ Object
9
10
11
|
# File 'app/decorators/tenon/application_decorator.rb', line 9
def edit_path
h.url_for([:edit, object])
end
|
#path ⇒ Object
5
6
7
|
# File 'app/decorators/tenon/application_decorator.rb', line 5
def path
h.url_for(object)
end
|
#published? ⇒ Boolean
21
22
23
24
25
26
27
28
29
|
# File 'app/decorators/tenon/application_decorator.rb', line 21
def published?
if object.try(:publish_at)
object.publish_at <= Time.now
elsif object.respond_to?(:published)
object.published
else
true
end
end
|