Sha256: 5959740fd8b5cc67f40bbb739263fc3fa99117b3fe477dd8e21c9f5b757182b8
Contents?: true
Size: 771 Bytes
Versions: 18
Compression:
Stored size: 771 Bytes
Contents
class ComboboxInput < SimpleForm::Inputs::CollectionSelectInput include ActionView::Helpers::UrlHelper include BootstrapHelper def link_fragment reference = object.send(reflection.name) if reference template.content_tag('span', template.link_to(boot_icon("eye-open"), object.send(reflection.name)), :class => 'combobox-link') else url_method = "new_#{reflection.name}_#{object.class.model_name.underscore.pluralize}_url" if template.respond_to?(url_method) template.content_tag('span', template.link_to(boot_icon("plus"), template.send(url_method), :remote => true), :class => "combobox-link new_#{reflection.name}") end end end def input input_html_classes.push 'span' super + link_fragment end end
Version data entries
18 entries across 18 versions & 1 rubygems