0

In a ruby app I have a post model and a writer model. in the form I have a column for writer. I want to use in the form instead of collection_select something like I will type "sh" and this will filter all writers name and show me list that start with sh. and When I select one it will be inside the form and writer id will be saved.

how to do so?

  • Possible duplicate of http://stackoverflow.com/questions/22507669/how-to-get-jquery-ui-autocomplete-working-with-rails-4 , just you have put efforts to google it – Sonalkumar sute Apr 07 '15 at 10:27
  • I wouldn't say it's a duplicate of that question so much, but definitely extremely relevant. Additionally though, this question is very broad as it does not presently demonstrate prior research effort or first attempt to solve the problem. – Paul Richter Apr 07 '15 at 13:52

3 Answers3

1

So you just need an autocomplete feature. One of the easiest way is to use select2

Artur Dębski
  • 34
  • 1
  • 3
1

The question is quite extensive and I am not in a position to write your code for you but I would have a closer look at jQuery Autocomplete if I were you. There is a gem you can use that comes with pretty extensive instructions and documentation. https://github.com/peterwillcn/rails4-autocomplete.

Thomas
  • 622
  • 5
  • 13
0

hey if your using Rails 3 then also you can achieve this by following this link autocomplete gem. Configuration of this gem also easy and simple to use. With this gem you achieve this by using text box only.

Gaurav Mamidwar
  • 338
  • 1
  • 12