Project

General

Profile

Design a Formular in a view

The main Formular-Definition

Always use the following format to create a new Formular

<fieldset>
    <legend class="icon LEGEND_ICON_CLASS"><span>TITLE</span></legend>
    <div class="form">
        <%= label_tag :FIELD, "LABEL", :class=>"span-4" %>
        <%= text_field_tag :FIELD %>
    </div>
...
</fieldset>

The LEGEND_ICON_CLASS can be one of the following:
  • contact : An Address-Card
  • address : A House
  • personal : A Person
  • note : A Note-Paper
  • pirateparty : The PirateParty Logo
  • secure : A user with a key
  • date : A Calendar

If you don't want an Icon, remove also the "icon" class from the class-Attribute.

TITLE is the Field-Group Heading. Attention, this has to be i18n compatible in future Versions
LABEL Label to show. Attention, this has to be i18n compatible in future Versions
FIELD is the Field from the model

Submit-Button

The Submit-Button has to be defined this way:

<%= button_tag content_tag(:span, "LABEL"), :class=>"button round" %>

Or if you like an Icon:

<%= button_tag content_tag(:span, "LABEL", :class=>"icon BUTTON_ICON_CLASS"), :class=>"button round" %>

The BUTTON_ICON_CLASS is not used at the moment, but can be used in future to print an Icon onto the Button.
LABEL is the Label which is shown inside the Button

Also available in: PDF HTML TXT