Class: Decidim::ParticipatoryDocuments::SuggestionAuthorCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::ParticipatoryDocuments::SuggestionAuthorCell
- Includes:
- SanitizeHelper
- Defined in:
- app/cells/decidim/participatory_documents/suggestion_author_cell.rb
Instance Method Summary collapse
- #author_avatar_url ⇒ Object
- #author_name ⇒ Object
- #author_profile_path ⇒ Object
- #avatar ⇒ Object
- #creation_date ⇒ Object
- #show ⇒ Object
- #suggestion ⇒ Object
Instance Method Details
#author_avatar_url ⇒ Object
13 14 15 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 13 def model..avatar.attached? ? avatar_url : default_avatar_url(:thumb) end |
#author_name ⇒ Object
17 18 19 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 17 def model..name end |
#author_profile_path ⇒ Object
25 26 27 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 25 def decidim.profile_path(model..nickname) end |
#avatar ⇒ Object
21 22 23 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 21 def avatar model..avatar.attached? ? model..avatar : nil end |
#creation_date ⇒ Object
29 30 31 32 33 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 29 def creation_date date_at = model.try(:created_at) l date_at, format: :decidim_short end |
#show ⇒ Object
8 9 10 11 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 8 def show @suggestion = [:suggestion] render end |
#suggestion ⇒ Object
35 36 37 |
# File 'app/cells/decidim/participatory_documents/suggestion_author_cell.rb', line 35 def suggestion model end |