Module: Card::Set::Right::Follow::HtmlFormat

Extended by:
AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod028-follow/right/follow.rb

Instance Method Summary collapse

Instance Method Details

#follow_item(condition, button = true) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
# File 'platypus/tmp/set/gem-defaults/mod028-follow/right/follow.rb', line 74

def follow_item condition, button=true
  condition ||= "*always"
  wrap do
    card_form action: :update, success: { view: :follow_item } do
      [
        follow_item_hidden_tags(condition),
        (follow_item_button(condition) if button),
        follow_item_link(condition)
      ].compact
    end
  end
end

#rule_form_argsObject



87
88
89
# File 'platypus/tmp/set/gem-defaults/mod028-follow/right/follow.rb', line 87

def rule_form_args
  super.merge "data-update-foreign-slot": ".card-slot.follow_section-view"
end

#view: follow_itemObject

interface to view/alter a specific rule option



70
71
72
# File 'platypus/tmp/set/gem-defaults/mod028-follow/right/follow.rb', line 70

view :follow_item, cache: :never do
  follow_item Env.params[:condition]
end

#view: follow_statusObject

shows a follow item link for each of the current follow options



65
66
67
# File 'platypus/tmp/set/gem-defaults/mod028-follow/right/follow.rb', line 65

view :follow_status, cache: :never do
  wrap { haml :follow_status }
end