Skip to content

Commit b853a57

Browse files
committed
Merge pull request risuiowa#27 from dabit/contact-info
Updating my contact info
2 parents 0200318 + ec8ec0c commit b853a57

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

README.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,21 @@ Just add it to your app/assets/javascripts/application.js file
8989

9090
### Demo Application by [Yifei](https://github.com/yifeiwu)
9191

92-
A live demo can be seen
92+
A live demo can be seen
9393

9494
[here](https://rocky-thicket-9286.herokuapp.com/)
9595

9696
[source](https://github.com/yifeiwu/rails4-autocomplete-demo)
9797

98-
As a new developer, I had some issues getting this to work by following the documentation. However after trying some things and reading [Yoni Weisbrod](http://www.yoniweisbrod.com/autocomplete-magic-with-rails/)'s blog post, I was able to make the autocomplete work and implement a few useful features.
98+
As a new developer, I had some issues getting this to work by following the documentation. However after trying some things and reading [Yoni Weisbrod](http://www.yoniweisbrod.com/autocomplete-magic-with-rails/)'s blog post, I was able to make the autocomplete work and implement a few useful features.
9999

100100
##Some implemented features
101101

102-
1. The css has been changed such that the results show up better against the box of suggestions. See `<app/assets/stylesheets/food.scss>` for details. I obtained this from a gist(forgive me I don't remember who the author is at the moment, please contact me if you do and I'll give credit). Upon mouseover/arrowkey presses, the selection will be highlighted.
102+
1. The css has been changed such that the results show up better against the box of suggestions. See `<app/assets/stylesheets/food.scss>` for details. I obtained this from a gist(forgive me I don't remember who the author is at the moment, please contact me if you do and I'll give credit). Upon mouseover/arrowkey presses, the selection will be highlighted.
103103

104-
2. One Yoni's improvements, you can click on a suggested item to submit the search, instead of having to click on the submit button after clicking on the item. This is an example of how to hook onto the *railsAutocomplete.select* event.
104+
2. One Yoni's improvements, you can click on a suggested item to submit the search, instead of having to click on the submit button after clicking on the item. This is an example of how to hook onto the *railsAutocomplete.select* event.
105105

106-
3. The autocomplete is implemented in the context of a search form with a simple scope search(see the food model and controller).
106+
3. The autocomplete is implemented in the context of a search form with a simple scope search(see the food model and controller).
107107

108108
### Model Example
109109

@@ -130,7 +130,7 @@ This will create an action _autocomplete_brand_name_ on your controller, don't f
130130
resources :products do
131131
get :autocomplete_brand_name, :on => :collection
132132
end
133-
133+
134134
Verify this path using `rake routes`, you will need it later for the **view** section.
135135

136136
### Options
@@ -194,27 +194,30 @@ Only the object's id and the column you are searching on will be returned in JSO
194194

195195
#### :hstore
196196

197-
Added option to support searching in hstore columns.
197+
Added option to support searching in hstore columns.
198198

199-
Pass a hash with two keys: `:method` and `:key` with values: the hstore field name and the key of the hstore to search.
199+
Pass a hash with two keys: `:method` and `:key` with values: the hstore field name and the key of the hstore to search.
200200

201-
e.g `autocomplete :feature, :name, :hstore => {:method => 'name_translations', :key => 'en'}`
201+
e.g `autocomplete :feature, :name, :hstore => {:method => 'name_translations', :key => 'en'}`
202202

203203

204204
#### :scopes
205-
Added option to use scopes. Pass scopes in an array.
206-
e.g `:scopes => [:scope1, :scope2]`
205+
206+
Added option to use scopes. Pass scopes in an array.
207+
e.g `:scopes => [:scope1, :scope2]`
207208

208209
#### :column_name
209-
By default autocomplete uses method name as column name. Now it can be specified using column_name options
210-
`:column_name => 'name'`
210+
211+
By default autocomplete uses method name as column name. Now it can be specified using column_name options
212+
`:column_name => 'name'`
211213

212214
#### json encoder
215+
213216
Autocomplete uses Yajl as JSON encoder/decoder, but you can specify your own
214217

215218
class ProductsController < Admin::BaseController
216219
autocomplete :brand, :name do |items|
217-
CustomJSON::Encoder.encode(items)
220+
CustomJSON::Encoder.encode(items)
218221
end
219222
end
220223

@@ -253,10 +256,10 @@ NOTE: Setting the `:multiple` option to `true` will result in the chosen values
253256

254257
To have the first item be automatically focused on when the autocomplete menu is shown, add the `'data-auto-focus'` option and set it to `true`.
255258

256-
form_for @product do |f|
257-
f.autocomplete_field :brand_names, autocomplete_brand_name_products_path,
258-
'data-auto-focus' => true
259-
end
259+
form_for @product do |f|
260+
f.autocomplete_field :brand_names, autocomplete_brand_name_products_path,
261+
'data-auto-focus' => true
262+
end
260263

261264
Now your autocomplete code is unobtrusive, Rails style.
262265

@@ -269,10 +272,10 @@ To configure the behaviour if no matches are found, you can set the following op
269272

270273
These will change the behaviour globally. To set them on a single input field use:
271274

272-
f.autocomplete_field :brand_names, autocomplete_brand_name_products_path,
275+
f.autocomplete_field :brand_names, autocomplete_brand_name_products_path,
273276
'data-showNoMatches' => false
274277
#or
275-
f.autocomplete_field :brand_names, autocomplete_brand_name_products_path,
278+
f.autocomplete_field :brand_names, autocomplete_brand_name_products_path,
276279
'data-noMatchesLabel' => 'no brands found'
277280

278281

@@ -469,10 +472,3 @@ the future. Thanks!
469472

470473
Everyone on [this list](https://github.com/crowdint/rails3-jquery-autocomplete/contributors)
471474

472-
# About the Author
473-
474-
[Crowd Interactive](http://www.crowdint.com) is an American web design and development company that happens to work in Colima, Mexico.
475-
We specialize in building and growing online retail stores. We don’t work with everyone – just companies we believe in. Call us today to see if there’s a fit.
476-
Find more info [here](http://www.crowdint.com)!
477-
478-

rails-jquery-autocomplete.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
77
s.version = RailsJQueryAutocomplete::VERSION
88
s.platform = Gem::Platform::RUBY
99
s.authors = ["David Padilla", "Joiey Seeley", "Sundus Yousuf"]
10-
s.email = %q{david.padilla@crowdint.com joiey.seeley@gmail.com sundusahmedyousuf@gmail.com}
10+
s.email = %q{david@padilla.cc joiey.seeley@gmail.com sundusahmedyousuf@gmail.com}
1111
s.homepage = %q{https://github.com/bigtunacan/rails-jquery-autocomplete/}
1212
s.summary = %q{Use jQuery's autocomplete plugin with Rails 4+.}
1313
s.description = %q{Use jQuery's autocomplete plugin with Rails 4+.}

0 commit comments

Comments
 (0)