Class: Blog::PostDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- Blog::PostDecorator
- Defined in:
- app/decorator/blog/post_decorator.rb
Instance Method Summary collapse
- #link_to_author ⇒ Object
- #link_to_delete ⇒ Object
- #link_to_edit ⇒ Object
- #link_to_read_more ⇒ Object
- #link_to_show ⇒ Object
- #link_to_title ⇒ Object
Instance Method Details
#link_to_author ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'app/decorator/blog/post_decorator.rb', line 27 def h.link_to h.user_path(id: self.user), class: 'link-effect font-s13 font-w600', title: '', style: '' do h.content_tag :span do self.user.decorate.name end end end |
#link_to_delete ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/decorator/blog/post_decorator.rb', line 59 def link_to_delete h.link_to h.blog_post_path(id: self.id), method: 'delete', class: 'btn btn-danger btn-sm', title: 'Excluir', confirm: 'Deseja realmente excluir o registro?', style: 'color: #FFF; float: none;' do h.content_tag :span, class: 'fa fa-trash-o' do end end end |
#link_to_edit ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'app/decorator/blog/post_decorator.rb', line 49 def link_to_edit h.link_to h.edit_blog_post_path(id: self.id), class: 'btn btn-warning btn-sm', title: 'Alterar', style: 'color: #FFF; float: none;' do h.content_tag :span, class: 'fa fa-pencil' do end end end |
#link_to_read_more ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/decorator/blog/post_decorator.rb', line 15 def link_to_read_more h.link_to h.show_list_blog_posts_path(id: self.id), class: 'btn btn-info btn-sm', title: 'Visualizar', style: 'color: #FFF; float: none;' do h.content_tag :span do 'Continue Lendo...' end end end |
#link_to_show ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/decorator/blog/post_decorator.rb', line 5 def link_to_show h.link_to h.blog_post_path(id: self.id), class: 'btn btn-info btn-sm', title: 'Visualizar', style: 'color: #FFF; float: none;' do h.content_tag :span, class: 'fa fa-search' do end end end |
#link_to_title ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'app/decorator/blog/post_decorator.rb', line 38 def link_to_title h.link_to h.show_list_blog_posts_path(id: self.id), class: 'text-primary-dark', title: self.title do h.content_tag :span do self.title end end end |