Class: Decidim::FollowButtonCell
- Inherits:
-
ButtonCell
- Object
- ButtonCell
- Decidim::FollowButtonCell
- Defined in:
- app/cells/decidim/follow_button_cell.rb
Overview
This cell renders the button to follow the given resource.
Instance Method Summary collapse
Instance Method Details
#followers_count ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/cells/decidim/follow_button_cell.rb', line 12 def followers_count if model.respond_to?(:followers_count) model.followers_count else model.followers.size end end |
#id_option ⇒ Object
20 21 22 |
# File 'app/cells/decidim/follow_button_cell.rb', line 20 def id_option @id_option ||= [:mobile] ? "follow-mobile" : "follow" end |
#show ⇒ Object
6 7 8 9 10 |
# File 'app/cells/decidim/follow_button_cell.rb', line 6 def show return if model == current_user render end |