Class: Formtastic::Actions::LinkAction

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/formtastic/actions/link_action.rb

Instance Attribute Summary

Attributes included from Base

#builder, #method, #object, #object_name, #options, #template

Instance Method Summary collapse

Methods included from Base

#accesskey, #button_html, #button_html_from_options, #default_button_html, #default_wrapper_classes, #default_wrapper_html_options, #default_wrapper_id, #extra_button_html_options, #initialize, #text, #wrapper, #wrapper_class, #wrapper_classes_from_options, #wrapper_html_options, #wrapper_html_options_from_options, #wrapper_id, #wrapper_id_from_options

Methods included from LocalizedString

#model_name

Instance Method Details

#supported_methodsObject



69
70
71
# File 'lib/formtastic/actions/link_action.rb', line 69

def supported_methods
  [:cancel]
end

#to_htmlObject

TODO reset_action class?



74
75
76
77
78
# File 'lib/formtastic/actions/link_action.rb', line 74

def to_html
  wrapper do
    template.link_to(text, url, button_html)
  end
end

#urlObject



80
81
82
83
# File 'lib/formtastic/actions/link_action.rb', line 80

def url
  return options[:url] if options.key?(:url)
  :back
end