Sha256: ccfcbe44f0cac7a816650fd743764889a4297f040036510f8cab5433cee2acf1

Contents?: true

Size: 838 Bytes

Versions: 5

Compression:

Stored size: 838 Bytes

Contents

class StandardFormBuilder < AbstractFormBuilder
  def text_field_block(field, options={})
    @template.content_block_tag(:p) do
      html =  label(field)
      html << text_field(field, options)
    end
  end
  
  def text_area_block(field, options={})
    @template.content_block_tag(:p) do
      html =  label(field)
      html << text_area(field, options)
    end
  end
  
  def password_field_block(field, options={})
    @template.content_block_tag(:p) do
      html =  label(field)
      html << password_field(field, options)
    end
  end
  
  def file_field_block(field, options={})
    @template.content_block_tag(:p) do
      html =  label(field)
      html << file_field(field, options)
    end
  end
  
  def submit_block(caption)
    @template.content_block_tag(:p) do
      @template.submit_tag(caption)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sinatra_more-0.0.6 lib/sinatra_more/markup_plugin/form_builder/standard_form_builder.rb
sinatra_more-0.0.5 lib/sinatra_more/markup_plugin/form_builder/standard_form_builder.rb
sinatra_more-0.0.4 lib/sinatra_more/form_builder/standard_form_builder.rb
sinatra_more-0.0.3 lib/sinatra_more/form_builder/standard_form_builder.rb
sinatra_more-0.0.2 lib/sinatra_more/form_builder/standard_form_builder.rb