This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix formtastic_haml controller generator,
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
Showing
2 changed files
with
4 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
lib/generators/formtastic_haml/controller/controller_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
lib/generators/formtastic_haml/scaffold/templates/_form.haml.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |