Coder Social home page Coder Social logo

activeadmin-select2's People

Contributors

kiddrew avatar mfairburn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

activeadmin-select2's Issues

:select2_multiple returns Formtastic::UnknownInputError

When using...

form do |f|
  f.input :something, :as => :select2_multiple
end

...it returns a Formtastic::UnknownInputError with the error message: "Unable to find input class for select2_multiple." Using :select2 properly works, although (obviously) without the multiple option.

Forked as activeadmin-searchable_select

Hi Mark,

just wanted to let you know that I have created an Active Admin plugin called activeadmin-searchable_select which is based on the code of this repository. I mainly needed a way to fetch options via ajax and define JSON endpoints to provide these options.

I originally intended to make the changes in the context of a PR for activeadmin-select2, but diverged quite far from the original feature set during development. Also activeadmin-select2 provides additional features (multiple selects, tag selects) which I do not need at the moment and which would have been extra work to integrate with the new functionality.

I've included a link to this repository in the acknowledgements section of the readme and incorporated your copyright information into the license file. I removed your personal data from the gemspec since ownership of the new gem will be held by us. Please let me know if there is anything else you'd like me to change.

Thanks for your work on activeadmin-select2.

Best regards
Tim

Not working with input_html.

The gem worked perfectly when I did this:

   f.input :students, as: :select2_multiple, collection: Student.all

But when I add the ajax call I need, it stops working and a normal select is there.

 f.input :students, as: :select2_multiple, input_html: { class: "chosen activityStudents" }, collection: Student.all

uninitialized constant ActiveAdmin::Inputs::FilterSelect2MultipleInput::FilterBase

Hi,

I've tried adding this gem to my Rails app but it seems to be breaking somewhere. It's a pity because it was a really simple gem to use previously.

Here's the output Passenger is giving me when I restart after installing the gem:

uninitialized constant ActiveAdmin::Inputs::FilterSelect2MultipleInput::FilterBase (NameError)
/Users/iamlamb/.rvm/gems/ruby-2.1.5/bundler/gems/activeadmin-select2-e2c2bd12cd4e/lib/activeadmin/inputs/filter_select2_multiple_input.rb:5:in <class:FilterSelect2MultipleInput>' /Users/iamlamb/.rvm/gems/ruby-2.1.5/bundler/gems/activeadmin-select2-e2c2bd12cd4e/lib/activeadmin/inputs/filter_select2_multiple_input.rb:3:inmodule:Inputs'
/Users/iamlamb/.rvm/gems/ruby-2.1.5/bundler/gems/activeadmin-select2-e2c2bd12cd4e/lib/activeadmin/inputs/filter_select2_multiple_input.rb:2:in <module:ActiveAdmin>' /Users/iamlamb/.rvm/gems/ruby-2.1.5/bundler/gems/activeadmin-select2-e2c2bd12cd4e/lib/activeadmin/inputs/filter_select2_multiple_input.rb:1:in<top (required)>'
/Users/iamlamb/.rvm/gems/ruby-2.1.5/bundler/gems/activeadmin-select2-e2c2bd12cd4e/lib/activeadmin/select2.rb:3:in <top (required)>' /Users/iamlamb/.rvm/gems/ruby-2.1.5/bundler/gems/activeadmin-select2-e2c2bd12cd4e/lib/activeadmin-select2.rb:1:in<top (required)>'
/Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in require' /Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:inblock (2 levels) in require'
/Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in each' /Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:inblock in require'
/Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in each' /Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:inrequire'
/Users/iamlamb/.rvm/gems/ruby-2.1.5/gems/bundler-1.7.7/lib/bundler.rb:133:in require' /Users/iamlamb/RubymineProjects/Simply Lee/config/application.rb:7:in<top (required)>'
/Users/iamlamb/RubymineProjects/Simply Lee/config/environment.rb:2:in require' /Users/iamlamb/RubymineProjects/Simply Lee/config/environment.rb:2:in<top (required)>'
config.ru:3:in require' config.ru:3:inblock in

'
/Users/iamlamb/.rvm/gems/ruby-2.1.5@global/gems/rack-1.5.2/lib/rack/builder.rb:55:in instance_eval' /Users/iamlamb/.rvm/gems/ruby-2.1.5@global/gems/rack-1.5.2/lib/rack/builder.rb:55:ininitialize'
config.ru:1:in new' config.ru:1:in'
/usr/local/Cellar/passenger/4.0.53/libexec/helper-scripts/rack-preloader.rb:112:in eval' /usr/local/Cellar/passenger/4.0.53/libexec/helper-scripts/rack-preloader.rb:112:inpreload_app'
/usr/local/Cellar/passenger/4.0.53/libexec/helper-scripts/rack-preloader.rb:158:in <module:App>' /usr/local/Cellar/passenger/4.0.53/libexec/helper-scripts/rack-preloader.rb:29:inmodule:PhusionPassenger'
/usr/local/Cellar/passenger/4.0.53/libexec/helper-scripts/rack-preloader.rb:28:in `'

Thanks in advance

Multi_select filter not working in AA 1.0.0.pre1

Using ActiveAdmin 1.0.0.pre1 and everything was working fine until I tried to add some multiple select filters. I'm filtering records based on country codes in the form of 2 letter alpha codes via the Countries gem. If I declare my filter as follows:

  filter :country, as: :select, collection: Country.all

It produces the following source snippet and the filter works as expected a single country:

<div class="filter_form_field filter_select">
<label for="q_country" class="label">Country</label>
<select class="select2-input" id="q_country" name="q[country_in]">
<option value="AD">Andorra</option>

With a URI produced as follows:

http://localhost:3000/admin/mymodel?utf8=%E2%9C%93&q%5Bcountry_in%5D=CA&commit=Filter&order=id_desc

However if I try to get it working with multiple select via the following

  filter :country, as: :select2_multiple, collection: Country.all

I end up with an oddly formatted list item in the filter panel and the following source snippet:

<li class="select2_multiple input required" id="q_country_input">
<label for="q_country" class="label">Country<abbr title="required">*</abbr></label>
<input name="q[country][]" type="hidden" value="" />
<select class="select2-input" multiple="multiple" id="q_country" name="q[country][]">
<option value=""></option>
<option value="AD">Andorra</option>

The filter does not work at all even for single value selections and I end up with URIs like the following:

http://localhost:3000/admin/mymodel?utf8=%E2%9C%93&q%5Bcountry%5D%5B%5D=CA&commit=Filter&order=id_desc

Any idea what is causing the huge difference between select2_multiple and the default select2 behaviour? I am using select2_multiple in my forms and it works fine.

select 2 is used on all as: :select fields, I need to use normal select

Hello why select2 is forced an all the select fields of my admin page?
f.input :block_type, as: :select, :label => "Tipo Blocco", :collection => NewsItemBlock.block_types, input_html: {class: 'js-block-type-selector'}

I need this input to be a normal select, but the gem forces this to be a :select2 input.
as you can see in my uploaded image it is a typical select2 form, while i need a normal select.

please help me!

Schermata 2022-06-07 alle 16 21 25

What should be the base.js.coffee file?

Its contents are by default:

#= require jquery
#= require ./jquery_ui
#= require jquery_ujs
#= require_self
#= require_tree ./lib
#= require_tree ./ext
#= require_tree ./initializers

window.ActiveAdmin = {}

And how does it need to change, to add your string?
#= require active_admin/select2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.