Sha256: 12fe45c44d8f56c7b2cce6318f0e5ff518c59057ed1cf5c5ce625238c90276f3
Contents?: true
Size: 1.2 KB
Versions: 10
Compression:
Stored size: 1.2 KB
Contents
<%#= render :partial => "layouts/form_habtm_tag", :locals => { :model_class => @product, :model_name => "product", :plural_model_name => "products", :linked_model_name => "tag", :plural_linked_model_name => "tags", :namespace_bs => "admin", :field_to_search_for_linked_model => "name", :f => f } # Example to put in a _form.html.erb %> <% path_namespace = '/' + namespace_bs if not namespace_bs.blank? %> <div class="control-group"> <%= f.label plural_linked_model_name.to_sym, t(plural_linked_model_name.to_sym, :default => plural_linked_model_name.capitalize), :class => "control-label" %> <div class="controls"> <ul class="bs-tagit" id="<%= model_name %>_<%= linked_model_name %>_ids" name="<%= model_name %>[<%= linked_model_name %>_ids][]" data-url="<%= path_namespace %>/<%= plural_linked_model_name %>/search_and_filter.json" data-param="q[<%= field_to_search_for_linked_model %>_cont]" data-result="caption"> <% begin %> <% for elt in model_class.send(plural_linked_model_name) %> <li data-value="<%= elt.id %>"><%= elt.caption %></li> <% end %> <% rescue %> <% end %> </ul> </div> </div>
Version data entries
10 entries across 10 versions & 1 rubygems