Sha256: 899e4fbbc73f26ee1efbfde0d8835cb6b896d30aaf8958095413e2eff7e699ea

Contents?: true

Size: 1.09 KB

Versions: 24

Compression:

Stored size: 1.09 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 # unless -%>
<%- 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 -%>
<%- 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 # if -%>
<%- end # model.attributes.each -%>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mdd-3.1.4 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.1.2 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.1.1 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.1.0 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.20 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.19 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.18 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.17 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.16 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.15 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.14 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.13 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.10 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.9 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.8 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.7 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.6 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.4 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.3 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb
mdd-3.0.2 lib/generators/mdwa/scaffold/templates/views/_form_fields.html.erb