Class: AgileFormFields::Action
- Inherits:
-
AgileFormField
- Object
- AgileFormField
- AgileFormFields::Action
- Defined in:
- app/models/agile_form_fields/action.rb
Overview
Implementation of action AgileRails form field. Actions can also be inserted on the form like just like on action pane.
===Form options:
type:action (required)action_type:link, submit or ajax action (default link)caption:Caption for actionicon:Action iconurl:direct url linkcontroller:controller nameaction:action namehtml:html options which apply to link_to (optional)
Form example:
30:
type: action
action_type: popup
caption: Some action
icon: cogs
controller: my_controller
action: my_action
id: id # will be replaced by record.id
Instance Attribute Summary
Attributes inherited from AgileFormField
Instance Method Summary collapse
-
#render ⇒ Object
Render link_to field html code.
Methods inherited from AgileFormField
get_data, #hash_to_options, #html, #initialize, #options_to_hash, #record_text_for, #ro_standard, #set_css_code, #set_default_value, #set_initial_value, #set_style, #t
Constructor Details
This class inherits a constructor from AgileFormFields::AgileFormField
Instance Method Details
#render ⇒ Object
Render link_to field html code
54 55 56 57 58 |
# File 'app/models/agile_form_fields/action.rb', line 54 def render @yaml['type'] = @yaml['action_type'] || 'link' @html += '<ul class="action">' + @env.agile_link_ajax_window_submit_action(@yaml, @record) + '</ul>' self end |