Class: AndyAdmin::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
lib/generators/andy_admin/templates/form_builder.rb

Instance Method Summary collapse

Instance Method Details

#actionsObject



32
33
34
# File 'lib/generators/andy_admin/templates/form_builder.rb', line 32

def actions
  @template.concat @template.(:div, yield.html_safe, :class => "actions")
end

#cancel(label, link) ⇒ Object



42
43
44
# File 'lib/generators/andy_admin/templates/form_builder.rb', line 42

def cancel(label, link)
  @template.(:a, label.html_safe, :href => link)
end

#submit(label, *args) ⇒ Object



36
37
38
39
40
# File 'lib/generators/andy_admin/templates/form_builder.rb', line 36

def submit(label, *args)
  options = args.extract_options!
  options[:colour] ||= "green"
  @template.(:button, label.html_safe, :class => "awesome #{options[:colour]}", :type => "submit")
end