Module: ActsAsCaesar::Rails::ViewHelpers

Defined in:
lib/acts_as_caesar/rails/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_caesar(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/acts_as_caesar/rails/view_helpers.rb', line 7

def acts_as_caesar(options = {})
  (:div, options[:content] || '', (options[:html] || {}).merge({
    "data-candidate" => Candidate.new(options[:candidate]).key,
    "data-voter" => Voter.new(options[:voter]).key,
    "data-acts-as-caesar" => 'uninit',
    "data-base-path" => options[:base_path]
  }.delete_if { |k,v| v.blank? }))
end