Sha256: f1c6ec3352d6177b55767404b65c2efa08a070a59e39fd5d80b1b00530207f8f
Contents?: true
Size: 1.27 KB
Versions: 24
Compression:
Stored size: 1.27 KB
Contents
<% files = attributes.select {|a| a.name.match(/_content_type|_file_size|_file_name/)}.map {|a| a.name.split('_')[0..-3].join('_')}.uniq -%> <% collections = attributes.select {|a| a.name.match(/_id$/)}.map {|a| a.name.gsub(/_id$/, '')}.uniq -%> = form_for [:forge, @<%= singular_name %>], :builder => ForgeFormBuilder do |f| = error_messages_for :<%= singular_name %> <% collections.each do |c| %> %h3 <%= c.titleize %> = f.collection_select :<%=c%>_id, @<%= c.pluralize %>, :id, :title %hr <% end -%> <% attributes.reject {|a| a.field_type.to_s == "text_area" || ["timestamp", "datetime"].include?(a.type.to_s) }.reject {|a| a.name.match(/_id$/)}.each do |attribute| -%> <% if !attribute.name.match(/_content_type|_file_size|_file_name/) && !['list_order', 'published'].include?(attribute.name) -%> = f.text_field :<%= attribute.name %> <% elsif attribute.name == "published" -%> = publish_box(f, @<%= singular_name %>) %hr <% end -%> <% end -%> <% attributes.select { |a| ["datetime", "timestamp"].include?(a.type.to_s) }.each do |f| -%> = f.datetime_widget :<%= f.name %> <% end -%> <% files.each do |f| -%> %h3 <%= f.titleize %> = file_select_widget(f, :<%= f %>, :allow_remove => true) <% end -%> %hr = button_link "Save", "javascript:;", :class => "submit button"
Version data entries
24 entries across 24 versions & 1 rubygems