// Render simple form parameters in block style.

// Fetch parameters.

- params ||= []
- focus ||= focus.nil?
- report ||= report.nil? && request.post?

// Choose parameter to focus on if enabled.

- focused = params.find{ |x| x.invalid? } || params.find{ |x| x.blank? } || params.first if focus

// Render each parameter, reporting errors as necessary.

- for p in params
  - case p.type
  - when :ignore
  - when :hidden
    input type='hidden' name=p.form_name value=p.form_value
  - else
    .form-group
      input.form-control type=p.type name=p.form_name value=p.form_value placeholder=p.form_title autofocus=(p == focused)
      - if report and error = p.error
        .help-block
          span.text-danger = error

// EOF //

// Render simple form parameters in block style.

// Fetch parameters.

- params ||= []
- focus ||= focus.nil?
- report ||= report.nil? && request.post?

// Choose parameter to focus on if enabled.

- focused ||= params.find{ |x| x.invalid? } || params.find{ |x| x.blank? } || params.first if focus

// Render each parameter, reporting errors as necessary.

- for p in params
  - case p.type
  - when :ignore
  - when :hidden
    input type='hidden' name=p.form_name value=p.form_value
  - else
    .form-group
      input.form-control type=p.type name=p.form_name value=p.form_value placeholder=p.form_title autofocus=(p == focused)
      - if report and error = p.error
        .help-block
          span.text-danger = error

// EOF //

Fix passing of focused parameter to the example snippet.
Fix passing of focused parameter to the example snippet.

raxoft/form_input