Formtastic::Helpers::ActionsHelper

Parsed documentation:
View on GitHub
ActionsHelper encapsulates the responsibilties of the {#actions} DSL for acting on 
(submitting, cancelling, resetting) forms.

{#actions} is a block helper used to wrap the form's actions (buttons, links) in a 
`<fieldset>` and `<ol>`, with each item in the list containing the markup representing a 
single action.

    <%= semantic_form_for @post do |f| %>
      ...
      <%= f.actions do %>
        <%= f.action :submit
        <%= f.action :cancel
      <% end %>
    <% end %>

The HTML output will be something like:

    <form class="formtastic" method="post" action="...">
      ...
      <fieldset class="actions">
        <ol>
          <li class="action input_action">
            <input type="submit" name="commit" value="Create Post">
          </li>
          <li class="action input_action">
            <a href="/posts">Cancel Post</a>
          </li>
        </ol>
      </fieldset>
    </form>

It's important to note that the `semantic_form_for` and {#actions} blocks wrap the
standard Rails `form_for` helper and form builder, so you have full access to every standard
Rails form helper, with any HTML markup and ERB syntax, allowing you to "break free" from
Formtastic when it doesn't suit to create your own buttons, links and actions:

    <%= semantic_form_for @post do |f| %>
      ...
      <%= f.actions do %>
        <li class="save">
          <%= f.submit "Save" %>
        <li>
        <li class="cancel-link">
          Or <%= link_to "Cancel", posts_url %>
        <li>
      <% end %>
    <% end %>

There are many other syntax variations and arguments to customize your form. See the
full documentation of {#actions} and {#action} for details.
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.