Class: MasterView::Directives::Form

Inherits:
MasterView::DirectiveBase show all
Defined in:
lib/masterview/directives/form.rb

Overview

creates start_form_tag and end_form_tag from values in form

Constant Summary

Constants included from MasterView::DirectiveHelpers

MasterView::DirectiveHelpers::CRLF, MasterView::DirectiveHelpers::ERB_END, MasterView::DirectiveHelpers::ERB_EVAL, MasterView::DirectiveHelpers::ERB_START

Instance Method Summary collapse

Methods inherited from MasterView::DirectiveBase

#append_to_attr_value!, #attr_lckv_matches, #attr_value, #attr_value=, #attrs, #attrs=, #attrs_lck, #attrs_lckv, #common_html_options, #content, #content=, #content_str, #data, #data=, #erb, #erb_content, full_attr_name, #initialize, #merge_hash_attr_value!, #parse_attr_value, #prepend_to_attr_value!, #quote, register_directive, #remove_strings_from_attr_value!, #save_directive_call_stack, #tag_name, #tag_name=

Methods included from MasterView::DirectiveHelpers

#delete_last_in_parent, #find_last_in_parent, #find_string_val_in_string_hash, #lowercase_attribute_keys, #lowercase_attribute_keys_and_values, #merge_into_embedded_hash, #parse, #parse_eval_into_array, #parse_eval_into_hash, #remove_prepended_strings

Methods included from PluginLoadTracking

included

Constructor Details

This class inherits a constructor from MasterView::DirectiveBase

Instance Method Details

#etag(directive_call_stack) ⇒ Object



14
15
16
# File 'lib/masterview/directives/form.rb', line 14

def etag(directive_call_stack)
  erb_content('end_form_tag')
end

#stag(directive_call_stack) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/masterview/directives/form.rb', line 6

def stag(directive_call_stack)
  options = {}
  options[:multipart] = true if attr_lckv_matches('enctype', 'multipart/form-data')
  options[:method] = 'get' if attr_lckv_matches('method', 'get')
  merge_hash_attr_value!(1, options)
  erb_content('form_tag ' + attr_value)
end