constructorio-rails 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/constructorio-rails/helper.rb +1 -1
- data/lib/constructorio-rails/version.rb +1 -1
- data/lib/constructorio-rails.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: add856357061727733d8d0e8bb7dfe491ba969b9
|
4
|
+
data.tar.gz: 29bb42d24dc96b9190275c62d2d09dcf809a81a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94dfec7c4db091d29510a6a3afabccf02eba9bd4315ddec7932e6cc84ebb704d4078f08aa047e628084172ef22e8af3fcccac8bc5ce13d3056593ce10de8fe8d
|
7
|
+
data.tar.gz: 416a0a64e00cd0f31e03d371273ff344101dbad77f6c13cba8ca3bc32927da71c36c6b320370f39099334d0b19ff633dc5749473fe1616f3e1a8f18af887545a
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Constructor.io
|
2
2
|
|
3
|
-
A
|
3
|
+
A Rails client for the [Constructor.io API](http://constructor.io/docs). Constructor.io provides a lightning-fast, typo-tolerant autocomplete service that ranks your users' queries by popularity to let them find what they're looking for as quickly as possible.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
gem 'constructorio'
|
9
|
+
gem 'constructorio-rails'
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
@@ -14,7 +14,7 @@ And then execute:
|
|
14
14
|
|
15
15
|
Or install it yourself:
|
16
16
|
|
17
|
-
$ gem install customerio
|
17
|
+
$ gem install customerio-rails
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
@@ -22,7 +22,7 @@ Or install it yourself:
|
|
22
22
|
|
23
23
|
Add an initializer file at config/initializers/constructor-io.rb with values from the [customer dashboard](http://constructor.io/dashboard):
|
24
24
|
```
|
25
|
-
|
25
|
+
ConstructorIORails.configure do |config|
|
26
26
|
config.api_token = 'API_TOKEN'
|
27
27
|
config.autocomplete_key = 'AUTOCOMPLETE_KEY'
|
28
28
|
end
|
@@ -31,7 +31,7 @@ To add autocomplete to a model:
|
|
31
31
|
|
32
32
|
```
|
33
33
|
class MyModel < ActiveRecord::Base
|
34
|
-
include
|
34
|
+
include ConstructorIORails
|
35
35
|
constructorio_autocomplete(['attribute1', 'attribute2'])
|
36
36
|
end
|
37
37
|
|
data/lib/constructorio-rails.rb
CHANGED
@@ -98,7 +98,7 @@ module ConstructorIORails
|
|
98
98
|
|
99
99
|
def constructorio_call_api(method, value, metadata, autocomplete_key)
|
100
100
|
api_token = ConstructorIORails.configuration.api_token
|
101
|
-
api_url = ConstructorIORails.configuration.api_url || "https://ac.
|
101
|
+
api_url = ConstructorIORails.configuration.api_url || "https://ac.cnstrc.com/"
|
102
102
|
@http_client ||= Faraday.new(url: api_url)
|
103
103
|
@http_client.basic_auth(api_token, '')
|
104
104
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constructorio-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Lai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|