Class: Formtastic::Actions::LinkAction
- Inherits:
-
Object
- Object
- Formtastic::Actions::LinkAction
- Includes:
- Base
- Defined in:
- lib/formtastic/actions/link_action.rb
Overview
document i18n keys
document i18n translation with :label (?)
:prefix and :suffix options? (can also be done with CSS or subclassing for custom Actions)
Outputs a link wrapped in the standard <li>
wrapper. This the default for :cancel
actions.
The link's URL defaults to Rails' built-in :back
macro (the HTTP referrer, or Javascript for the
browser's history), but can be altered with the :url
option.
Instance Attribute Summary
Attributes included from Base
#builder, #method, #object, #object_name, #options, #template
Instance Method Summary collapse
- #supported_methods ⇒ Object
-
#to_html ⇒ Object
TODO reset_action class?.
- #url ⇒ Object
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
Instance Method Details
#supported_methods ⇒ Object
71 72 73 |
# File 'lib/formtastic/actions/link_action.rb', line 71 def supported_methods [:cancel] end |
#to_html ⇒ Object
TODO reset_action class?
76 77 78 79 80 |
# File 'lib/formtastic/actions/link_action.rb', line 76 def to_html wrapper do template.link_to(text, url, ) end end |
#url ⇒ Object
82 83 84 85 |
# File 'lib/formtastic/actions/link_action.rb', line 82 def url return [:url] if .key?(:url) :back end |