Module: Zafu::Process::Forms
- Defined in:
- lib/zafu/process/forms.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/zafu/process/forms.rb', line 4 def self.included(base) base. :make_form end |
Instance Method Details
#r_form ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/zafu/process/forms.rb', line 8 def r_form = @markup.set_id([:id]) if [:id] @markup.set_param(:style, [:style]) if [:style] if descendant('form_tag') # We have a specific place to insert our form out (:form_options => , :form => self) else r_form_tag() end end |
#r_form_tag(options = context[:form_options]) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/zafu/process/forms.rb', line 22 def r_form_tag( = context[:form_options]) if .blank? # <form> not in <r:form>, just render all markup = Zafu::Markup.new('form') @params.each do |k, v| markup.set_param(k, v) end else # <form> inside <r:form> form_tag() do |opts| # Render error messages tag (opts[:form_helper]) # Render form elements out (opts) # Render hidden fields (these must go after normal elements so that focusFirstElement works) hidden_fields = form_hidden_fields() out "<div class='hidden'>" hidden_fields.each do |k,v| if v.kind_of?(String) v = "'#{v}'" unless v.kind_of?(String) && ['"', "'"].include?(v[0..0]) out "<input type='hidden' name='#{k}' value=#{v}/>" else # We use ['ffff'] to indicate that the content is already escaped and ready for ERB. out v.first end end out '</div>' # What is this ? #@blocks = opts[:blocks_bak] if opts[:blocks_bak] end end end |