<?xml version=‘1.0’ encoding=‘utf-8’?> <!–

RHTML form helper snippets

–> <snippets language=“html-erb”>

<!-- Form tag blocks -->
<snippet>
  <text><![CDATA[<% form_tag $1do %>
      $0

<% end %>]]></text>

  <tag>ft</tag>
  <description>form tag</description>
</snippet>
<snippet>
  <text><![CDATA[<% form_tag $2, :method => ${1:post} do %>
      $0

<% end %>]]></text>

  <tag>ftm</tag>
  <description>form tag with method</description>
</snippet>
<snippet>
  <text><![CDATA[<label>$0</label>]]></text>
  <tag>ll</tag>
  <description>html label</description>
</snippet>
<snippet>
  <text><![CDATA[<label for="$1">$0</label>]]></text>
  <tag>lf</tag>
  <description>html label for</description>
</snippet>

<!-- ActiveRecord error display helpers -->
<snippet>
  <text><![CDATA[<%= error_messages_for( :$1 ) %>$0]]></text>
  <tag>emf</tag>
  <description>error messages for</description>
</snippet>

<!-- Form field helpers -->
<snippet>
  <text><![CDATA[<%= password_field :${1:model}, :${2:attribute} %>$0]]></text>
  <tag>pf</tag>
  <description>password field</description>
</snippet>

<snippet>
  <text><![CDATA[<%= submit_tag '${1:save}' %>$0]]></text>
  <tag>st</tag>
  <description>submit tag</description>
</snippet>

<snippet>
  <text><![CDATA[<%= text_field :${1:model}, :${2:attribute} %>$0]]></text>
  <tag>tf</tag>
  <description>text field</description>
</snippet>

<snippet>
  <text><![CDATA[<%= hidden_field :${1:model}, :${2:attribute} %>$0]]></text>
  <tag>hf</tag>
  <description>hidden field</description>
</snippet>

<snippet>
  <text><![CDATA[<%= check_box :${1:model}, :${2:attribute} %>$0]]></text>
  <tag>cb</tag>
  <description>checkbox</description>
</snippet>

<snippet>
  <text><![CDATA[<%= select :${1:model}, :${2:attribute}, ${3:values}, {:include_blank => true} %>$0]]></text>
  <tag>select</tag>
  <description>select field</description>
</snippet>

</snippets>