Class: Bbs::ArticleCell

Inherits:
ApplicationCell show all
Defined in:
app/cells/bbs/article_cell.rb

Instance Method Summary collapse

Methods inherited from ApplicationCell

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bbs::ApplicationCell

Instance Method Details

#article_bodyObject



12
13
14
15
16
# File 'app/cells/bbs/article_cell.rb', line 12

def article_body
  return body if logged_in? || !Bbs.config.clamp_article_body

  body.truncate([body.truncate_words(1).length, Bbs.config.clamp_article_body].min)
end

#avatar_urlObject



22
23
24
# File 'app/cells/bbs/article_cell.rb', line 22

def avatar_url
  author.profile.avatar.image.url(:medium)
end

#nicknameObject



18
19
20
# File 'app/cells/bbs/article_cell.rb', line 18

def nickname
  author.profile.nickname
end

#showObject



8
9
10
# File 'app/cells/bbs/article_cell.rb', line 8

def show
  render
end