Module Formtastic::SemanticFormHelper
In: lib/formtastic.rb

Wrappers around form_for (etc) with :builder => SemanticFormBuilder.

  • semantic_form_for(@post)
  • semantic_fields_for(@post)
  • semantic_form_remote_for(@post)
  • semantic_remote_form_for(@post)

Each of which are the equivalent of:

Example Usage:

  <% semantic_form_for @post do |f| %>
    <%= f.input :title %>
    <%= f.input :body %>
  <% end %>

The above examples use a resource-oriented style of form_for() helper where only the @post object is given as an argument, but the generic style is also supported, as are forms with inline objects (Post.new) rather than objects with instance variables (@post):

  <% semantic_form_for :post, @post, :url => posts_path do |f| %>
    ...
  <% end %>

  <% semantic_form_for :post, Post.new, :url => posts_path do |f| %>
    ...
  <% end %>

Constants

FIELD_ERROR_PROC = proc do |html_tag, instance_tag| html_tag   Override the default ActiveRecordHelper behaviour of wrapping the input. This gets taken care of semantically by adding an error class to the LI tag containing the input.

[Validate]