Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added multi column search #95

Closed
wants to merge 14 commits into from
Closed

Added multi column search #95

wants to merge 14 commits into from

Conversation

slash4
Copy link

@slash4 slash4 commented Sep 22, 2011

I added multicolumn search (still one model at a time, though), for ActiveRecord, I don't know how to reproduce it for Mongo mapper or Mongoid.

But I think it would be nice to adapt it too, cause its a rather important feature. Plus, its rather backward compatible as you can pass only one column as before, or an array of columns. The routes won't change, and the first column you pass is still the referent for order and select clauses.

What do you think of it ?

@cyrille
Copy link

cyrille commented Sep 28, 2011

+1 this is definitely nice to have !

@pviral
Copy link

pviral commented Oct 3, 2011

How can we define multiple column in controller.

autocomplete :brand, [:name, :id]

Is this correct way?

@slash4
Copy link
Author

slash4 commented Oct 3, 2011

Yes it is !

@pviral
Copy link

pviral commented Oct 3, 2011

Thanks for prompt response. However, i am not sure whether i m on right track as I am not able to get that work.

In routes.rb
get 'welcome/autocomplete_brand_name_id'

Controller
autocomplete :brand, [:name, :id]

View
<%= form_tag do %>
<%=text_field_tag 'name', '', :autocomplete => welcome_autocomplete_brand_name_id_path %>
<% end %>

Can u point where I am going wrong? I read the document but was not able to figure that thing out.

@slash4
Copy link
Author

slash4 commented Oct 4, 2011

welcome_autocomplete_brand_name_path should be the correct route . I patched the code so as not to alter the route, which is still built from controller_autocomplete_model_firstColumn_path.

Rgds, Alex

PS : are you using my fork ? The official gem is not including this feature .

@pviral
Copy link

pviral commented Oct 4, 2011

oh ok...I am using official gem...thanks for your response.

@hiattp
Copy link

hiattp commented Oct 4, 2011

Thanks for including this, definitely a must have! Wonder when the official gem will add it...?

@macmartine
Copy link

@slash4 your fork doesn't work:

[ pid=1947 thr=70175676387020 file=utils.rb:176 time=2011-11-05 21:19:39.773 ]: *** Exception TypeError in PhusionPassenger::Rack::ApplicationSpawner (superclass mismatch for class SemanticFormBuilder) (process 1947, thread #Thread:0x007fa618869d98):

However, the fix does work. I manually added it to my own fork and it's great --- thanks!

@slash4
Copy link
Author

slash4 commented Nov 9, 2011

Thats weird, we use it here in development and production mode without any problem. What is your configuration (database, rails version, etc?)

Rgds Alex

@macmartine
Copy link

Rails 3.1.1
Postgresql

Looks like it was fixed here #32 and only was an issue with Formtastic 2. I'm currently running off my own fork where I manually incorporated your fix.

@macmartine
Copy link

This works great -- any plans to merge it?

@juniorjp
Copy link

A must have!

@juniorjp
Copy link

Does it have a gem? I need to deploy to Heroku, how shoud I do to maintain slash4 fork?

@luxflux
Copy link

luxflux commented May 2, 2012

This is what I'm looking for. Will someone merge this?

@Znow
Copy link

Znow commented Jun 15, 2012

When will this be added?!?!

@subhashreev
Copy link

how to access with selected id in form?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants