Class: Blog::PostDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/decorator/blog/post_decorator.rb

Instance Method Summary collapse

Instance Method Details



27
28
29
30
31
32
33
34
35
36
# File 'app/decorator/blog/post_decorator.rb', line 27

def link_to_author
  h.link_to h.user_path(id: self.user),
            class: 'link-effect font-s13 font-w600',
            title: '',
            style: '' do
    h. :span do
      self.user.decorate.name
    end
  end
end


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. :span, class: 'fa fa-trash-o' do
    end
  end
end


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. :span, class: 'fa fa-pencil' do
    end
  end
end


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. :span do
      'Continue Lendo...'
    end
  end
end


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. :span, class: 'fa fa-search' do
    end
  end
end


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. :span do
      self.title
    end
  end
end