Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
fix formtastic_haml controller generator,
Browse files Browse the repository at this point in the history
scaffold generator
  add -f.inputs block around inputs, remove _id from name
  • Loading branch information
Luzifer Altenberg committed May 11, 2010
1 parent 7b96afe commit b276d22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
@@ -1,4 +1,4 @@
require 'generators/formtastic'
require 'generators/formtastic_haml'
require 'rails/generators/named_base'

module FormtasticHaml
Expand Down
@@ -1,9 +1,10 @@
- semantic_form_for @<%= singular_name %> do |form|
<%- if attributes.empty? -%>
- form.inputs
= form.inputs
<%- else -%>
- form.inputs do
<%- for attribute in attributes -%>
= form.input :<%= attribute.name %>, :label => '<%= attribute.name.titleize %>'
= form.input :<%= attribute.name.gsub(/_id$/, '') %>, :label => '<%= attribute.name.titleize %>'
<%- end -%>
<%- end -%>
= form.buttons

0 comments on commit b276d22

Please sign in to comment.