Sha256: f704fa59b351aee7ca50885737ae711754a698f8ac693e2cb4ff26da8957c520
Contents?: true
Size: 1.87 KB
Versions: 1
Compression:
Stored size: 1.87 KB
Contents
<%% content_for :body do %> <div class='<%= plural_name %>'> <%%=raw @page.content_for(Refinery::Pages.default_parts.first.to_sym) %> <%%= form_for [refinery, :<%= namespacing.underscore %>, @<%= singular_name %>] do |f| %> <%%= render '/refinery/admin/error_messages', :object => @<%= singular_name %>, :include_object_name => true %> <% string_fields = attributes.map{ |a| a.name if a.type.to_s =~ /string|text/ }.compact.uniq -%> <% attributes.each do |attribute| %> <div class='field <%= attribute.name %>_field <%= attribute.type %>_field'> <%%= f.<%= 'required_' if string_fields.any? && attribute.name == string_fields.first %>label :<%= attribute.name %> %> <% case attribute.type when :string -%> <%%= f.text_field :<%= attribute.name %> %> <% when :text -%> <%%= f.text_area :<%= attribute.name %>, :rows => 8 %> <% when :radio -%> <%% <%= class_name %>::<%= attribute.name.pluralize.upcase %>.each do |value, name| %> <%%= f.radio_button :<%= attribute.name %>, (name || value), :value => value %> <%%= f.label :"<%= attribute.name %>_#{(name || value)}", value.humanize %> <%% end %> <% when :checkbox -%> <%%= f.check_box :<%= attribute.name %> %> <% when :select -%> <%%= f.select :<%= attribute.name %>, Refinery::<%= namespacing %>::<%= class_name %>::<%= attribute.name.pluralize.upcase %>, :include_blank => true %> <% when :datetime -%> <%%= f.datetime_select :<%= attribute.name %> %> <% when :date -%> <%%= f.date_select :<%= attribute.name %> %> <% when :time -%> <%%= f.time_select :<%= attribute.name %> %> <% end -%> </div> <% end %> <div class='actions'> <%%= f.submit t('.send') %> </div> <%% end %> </div> <%% end %> <%%= render '/refinery/content_page' %>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
refinerycms-core-2.0.5 | lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb |