Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Form generator: |f| is a better default for |form|. Also works better…

… with the bundle. Closing #151.
  • Loading branch information...
commit e57b9d1cc0e486c1baa21128391a4d11ab40065a 1 parent 04373ff
@grimen grimen authored committed
View
8 README.textile
@@ -439,10 +439,10 @@ $ ./script/generate form Post
# GENERATED FORMTASTIC CODE
# ---------------------------------------------------------
-<% form.inputs do %>
- <%= form.input :title, :label => 'Title' %>
- <%= form.input :body, :label => 'Body' %>
- <%= form.input :published, :label => 'Published' %>
+<% f.inputs do %>
+ <%= f.input :title, :label => 'Title' %>
+ <%= f.input :body, :label => 'Body' %>
+ <%= f.input :published, :label => 'Published' %>
<% end %>
# ---------------------------------------------------------
View
4 generators/form/templates/view__form.html.erb
@@ -1,5 +1,5 @@
-<%% form.inputs do %>
+<%% f.inputs do %>
<% attributes.each do |attribute| -%>
- <%%= form.input :<%= attribute.name %>, :label => '<%= attribute.name.humanize %>' %>
+ <%%= f.input :<%= attribute.name %>, :label => '<%= attribute.name.humanize %>' %>
<% end -%>
<%% end %>
View
4 generators/form/templates/view__form.html.haml
@@ -1,4 +1,4 @@
-- form.inputs do
+- f.inputs do
<% attributes.each do |attribute| -%>
- = form.input :<%= attribute.name %>, :label => '<%= attribute.name.humanize %>'
+ = f.input :<%= attribute.name %>, :label => '<%= attribute.name.humanize %>'
<% end -%>
Please sign in to comment.
Something went wrong with that request. Please try again.