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

Version Path
forge-cli-0.1.10 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.9 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.8 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.7 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.6 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.5 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.4 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.3 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.2 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.1 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.1.0 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.18 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.17 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.16 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.15 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.14 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.13 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.12 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.11 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml
forge-cli-0.0.10 lib/forge/lib/generators/forge/scaffold_small/templates/view__form.html.haml