<% content_for :header, javascript_include_tag('admin/formbuilder') %> <% content_for :header, javascript_include_tag( 'tiny_mce/jquery.tinymce', 'admin/tiny_mce_config', 'admin/nodes', 'admin/assets' ) %>

Editing a Form

* Required Fields

<%= form_for(@form, :as => 'form', :url => (@form.new_record? ? noodall_admin_forms_path : noodall_admin_form_path(@form.id)) ) do |f| %> <%= f.error_messages %>

  <%= f.label :title, 'Title *' %>
<%= f.text_field :title %>

  <%= f.label :description, 'Description' %>
<%= f.text_area :description, :rows => 3 %>

  <%= f.label :email, 'Email *' %>
<%= f.text_field :email %>

  <%= f.label :thank_you_message %>
<%= f.text_area :thank_you_message, :rows => 3 %>

  <%= f.label :thank_you_email %>
<%= f.text_area :thank_you_email, :rows => 3 %>

<%= render :partial => 'field_select' %>

Examples: Name, Telephone, Message

A text field can be 1 or more rows. A single row is used for recording something like a name or telephone number, multiple rows for something like a contact message.

Examples: Types of Enquiry, Types of Postal Delivery

Examples: Yes or No Questions, Multiple Choice

The radio button only allows one option to be chosen.

Examples: Selection of Favourite Dishes, Selection of Outdoor Activities

Check boxes can be on or off and unlike radio buttons in any number or combination

<% @form.fields.each_with_index do |field, index| %> <%= render :partial => "noodall/admin/fields/#{field.class.name.gsub(/^Noodall::/, '').tableize.singularize}", :locals => {:field => field, :index => index} %> <% end %>
Name   Type   Label   Default   Rows   Options   Required   Arrange Delete  
Name   Type   Label   Default   Rows   Options   Required   Arrange Delete  
<%= f.submit @form.new_record? ? 'Create' : 'Update', :disable_with => 'Submitting...', :class => (@form.new_record? ? 'create' : 'update') %> <%= link_to 'Cancel', noodall_admin_forms_path, :class => 'cancel' %>
<% end %>