--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: contents if block_given?
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Returns an entire form with all needed input tags for a specified Active Record object. For example, let's say you have a table model <tt>Post</tt> with attributes named <tt>title</tt> of type <tt>VARCHAR</tt> and <tt>body</tt> of type <tt>TEXT</tt>:"
- !ruby/struct:SM::Flow::VERB 
  body: "  form(&quot;post&quot;)\n"
- !ruby/struct:SM::Flow::P 
  body: "That line would yield a form like the following:"
- !ruby/struct:SM::Flow::VERB 
  body: "    &lt;form action='/post/create' method='post'&gt;\n      &lt;p&gt;\n        &lt;label for=&quot;post_title&quot;&gt;Title&lt;/label&gt;&lt;br /&gt;\n        &lt;input id=&quot;post_title&quot; name=&quot;post[title]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;Hello World&quot; /&gt;\n      &lt;/p&gt;\n      &lt;p&gt;\n        &lt;label for=&quot;post_body&quot;&gt;Body&lt;/label&gt;&lt;br /&gt;\n        &lt;textarea cols=&quot;40&quot; id=&quot;post_body&quot; name=&quot;post[body]&quot; rows=&quot;20&quot;&gt;\n        &lt;/textarea&gt;\n      &lt;/p&gt;\n      &lt;input type='submit' value='Create' /&gt;\n    &lt;/form&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: "It's possible to specialize the form builder by using a different action name and by supplying another block renderer. For example, let's say you have a model <tt>Entry</tt> with an attribute <tt>message</tt> of type <tt>VARCHAR</tt>:"
- !ruby/struct:SM::Flow::VERB 
  body: "  form(&quot;entry&quot;, :action =&gt; &quot;sign&quot;, :input_block =&gt;\n       Proc.new { |record, column| &quot;#{column.human_name}: #{input(record, column.name)}&lt;br /&gt;&quot; }) =&gt;\n\n    &lt;form action='/post/sign' method='post'&gt;\n      Message:\n      &lt;input id=&quot;post_title&quot; name=&quot;post[title]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;Hello World&quot; /&gt;&lt;br /&gt;\n      &lt;input type='submit' value='Sign' /&gt;\n    &lt;/form&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: "It's also possible to add additional content to the form by giving it a block, such as:"
- !ruby/struct:SM::Flow::VERB 
  body: "  form(&quot;entry&quot;, :action =&gt; &quot;sign&quot;) do |form|\n    form &lt;&lt; content_tag(&quot;b&quot;, &quot;Department&quot;)\n    form &lt;&lt; collection_select(&quot;department&quot;, &quot;id&quot;, @departments, &quot;id&quot;, &quot;name&quot;)\n  end\n"
full_name: ActionView::Helpers::ActiveRecordHelper#form
is_singleton: false
name: form
params: (record_name, options = {}) {|contents if block_given?| ...}
visibility: public
