class PerUserStatus::Hooks::FormExtender

@private

Attributes

f[R]
view_context[R]

Public Class Methods

new(view_context, f) click to toggle source
# File lib/per_user_status/hooks.rb, line 35
def initialize(view_context, f)
  @view_context = view_context
  @f = f
end

Public Instance Methods

to_html() click to toggle source
# File lib/per_user_status/hooks.rb, line 40
def to_html
  content_tag(:p) do
    input + hint
  end
end

Private Instance Methods

content_tag(*args, &block) click to toggle source
# File lib/per_user_status/hooks.rb, line 59
def content_tag(*args, &block)
  view_context.content_tag(*args, &block)
end
hint() click to toggle source
# File lib/per_user_status/hooks.rb, line 48
def hint
  content_tag :span, class: "hint" do
    l(:per_user_status_form_hint)
  end
end
input() click to toggle source
# File lib/per_user_status/hooks.rb, line 54
def input
  label = l(:per_user_status_form_custom_status)
  f.text_field :custom_status, label: label
end
l(*args) click to toggle source
# File lib/per_user_status/hooks.rb, line 63
def l(*args)
  view_context.l(*args)
end