Sha256: 6cdaee2fe48adf14bd6446b849d0b4e0af5ec7b151a1faa46257645d5f1af7db
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
<%- @model.attributes.each do |attr| %> <%- unless attr.references? %> <div class="field"> <%%= f.label :<%= attr.name %> %> <%%= f.<%= attr.form_field %> :<%= attr.name %> %> </div> <%- end %> <%- if attr.belongs_to? %> <div class="field"> <%%= f.label :<%= attr.name %> %> <%%= f.select :<%= attr.name %>, options_for_select( <%= attr.type.klass %>.order('<%= attr.reference %> ASC').collect{ |c| [c.<%= attr.reference %>, c.id] }, f.object.<%= attr.name %> ), :prompt => '-- Select --' %> </div> <%- end %> <%- if attr.nested? %> <div class="nested"> <%%= f.fields_for :<%= (attr.nested_many?) ? attr.type.plural_name : attr.type.singular_name %> do |ff| %> <%%= render '<%= attr.type.space %>/<%= attr.type.plural_name %>/form_fields', :f => ff %> <%- unless attr.nested_one? %><%%= ff.link_to_remove t('nested.remove') %><%- end %> <%% end %> <%- unless attr.nested_one? %> <%%= f.link_to_add t('nested.add', :name => '<%= attr.type.singular_name %>'), :<%= attr.type.plural_name %> %> <%- end %> </div> <%- end %> <%- end %>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mdd-2.0.1 | lib/generators/mdd/scaffold/templates/views/_form_fields.html.erb |
mdd-2.0 | lib/generators/mdd/scaffold/templates/views/_form_fields.html.erb |