Skip to content

Instantly share code, notes, and snippets.

@gilsondev
Forked from jacobh/gist:2842966
Created November 8, 2013 23:57
Show Gist options
  • Save gilsondev/7379549 to your computer and use it in GitHub Desktop.
Save gilsondev/7379549 to your computer and use it in GitHub Desktop.
Template used for form fields with twitter bootstrap
{% for field in form %}
<div class="control-group {% if field.errors %}error{% endif %}">
<label class="control-label" for="{{ field.html_name }}">{{ field.label }}</label>
<div class="controls">
{{ field }}
{% if field.errors %}
<span class="help-inline">{{ field.errors|first }}</span>
{% endif %}
{% if field.help_text %}
<p class="help-block">{{ field.help_text }}</p>
{% endif %}
</div>
</div>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment