Sha256: c5ac2e5fe5820076e08b493cebee8a90faed9fcf751e3d5546328f05a4287a42
Contents?: true
Size: 1.79 KB
Versions: 2
Compression:
Stored size: 1.79 KB
Contents
<% formparams = [] %> <% if not namespace.blank? then %> <% formparams << namespace %> <% end %> <% formparams << model_name.camelize.constantize.new %> <%= form_for formparams, :method => :post, :html => { :class => "well well-small form-inline mass-inserting #{(params[:mass_inserting] ? 'setfocus' : '')}" } do |f| %> <%= hidden_field_tag :mass_inserting, true %> <% for col in model_columns %> <div <%= visible_column(model_name, col, 'inline') %> class="col-<%= col %>"> <%= ar = model_name.camelize.constantize.columns_hash[col] if not ar.nil? then case ar.type when :integer then if col =~ /.*_id/ then f.collection_select((col).to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_eq"].to_i rescue '' end) }, {:class => "form-control"}) else f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col)).capitalize, :class => "form-control") end when :boolean then ( "<label class='bs-label-ib'>#{f.check_box(col.to_sym, {}, true, false)}#{t(i18n_translate_path(model_name, col)).capitalize}</label>".html_safe ) else f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col)).capitalize, :class => "form-control") end else f.collection_select((col + '_id').to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_id_eq"].to_i rescue '' end) }, {:class => "form-control"}) end %> </div> <% end %> <div style="display:inline;"> <%= f.submit t(:create, :default => "Create"), :class => "btn btn-default" %> </div> <% end %>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
beautiful_scaffold-0.3.5 | lib/generators/templates/app/views/_mass_inserting.html.erb |
beautiful_scaffold-0.3.4 | lib/generators/templates/app/views/_mass_inserting.html.erb |