Permalink
Browse files

changed the form generator to include the wrapping semantic_form_for …

…block
  • Loading branch information...
1 parent df22871 commit d9b54b161b11e10b0afc0f77b316fcaff75c23d6 @justinfrench committed Jan 21, 2011
View
@@ -1,5 +1,6 @@
[v2 branch]
+* Changed formtastic:form generator include the wrapping semantic_form_for block
* Changed formtastic:form generator to generate a partial by default (instead of copying to clipboard, which can be done with --copy)
* Removed formtastic_stylesheet_link_tag
* Improved some documentation, much more to come
@@ -35,7 +35,6 @@ class FormGenerator < Rails::Generators::NamedBase
def create_or_show
@attributes = self.columns if @attributes.empty?
-
if options[:copy]
template = File.read("#{self.class.source_root}/_form.html.#{template_type}")
erb = ERB.new(template, nil, '-')
@@ -1,5 +1,7 @@
-<%%= f.inputs do %>
-<% attributes.each do |attribute| -%>
- <%%= f.input :<%= attribute.name %> %>
-<% end -%>
+<%%= semantic_form_for @<%= name.underscore %> do |f| %>
+ <%%= f.inputs do %>
+ <% attributes.each do |attribute| -%>
+ <%%= f.input :<%= attribute.name %> %>
+ <% end -%>
+ <%% end %>
<%% end %>
@@ -1,4 +1,5 @@
-= f.inputs do
-<% attributes.each do |attribute| -%>
- = f.input :<%= attribute.name %>
-<% end -%>
+= semantic_form_for @<%= name.underscore %> do |f|
+ = f.inputs do
+ <% attributes.each do |attribute| -%>
+ = f.input :<%= attribute.name %>
+ <% end -%>

0 comments on commit d9b54b1

Please sign in to comment.