search_rails 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +36 -4
- data/lib/search_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2c4db8f644e116908b0c668fb833aad1b62668d
|
4
|
+
data.tar.gz: f29f24f1c4ee40837b17e24e0f0c7b828918adf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213a62817b9ff99dde8ea08c1f7855794b686fbb7cecc8a29dc5e80fd9afdf99b161f238935592de3d283486d8aa2441800fbb705b9859921658926ed5966228
|
7
|
+
data.tar.gz: ffef939fccbcfb1bd4bfeced063311501697f86bce227370b6ffb23508d131870665f7a90e694bec3e7f65a02d6a18efbf3db6cf67b6c478761834968def7bc6
|
data/README.md
CHANGED
@@ -20,12 +20,45 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
To install the search functionality, type the command
|
23
|
+
To install the search functionality, type the command:
|
24
|
+
|
25
|
+
$ search:install
|
26
|
+
|
27
|
+
Then follow below.
|
28
|
+
|
29
|
+
The syntax for installing the search function is shown in the example below,
|
30
|
+
as if you are installing it for the table 'humans' and the attributes 'name' (string) and 'age' (integer):
|
31
|
+
|
32
|
+
$ install humans name:string age:integer
|
33
|
+
|
34
|
+
After that run:
|
35
|
+
|
36
|
+
$ rake db:migrate
|
37
|
+
|
38
|
+
Then insert the following form on whatever page you have set up for the search function:
|
24
39
|
|
25
40
|
```ruby
|
26
|
-
search
|
41
|
+
<%= form_for @search do |f| %>
|
42
|
+
<%= f.text_field :search %>
|
43
|
+
<%= link_to 'x', clear_search_path(@search) %>
|
44
|
+
<% end -%>
|
27
45
|
```
|
28
46
|
|
47
|
+
|
48
|
+
Then add the following lines to whatever controller action you want to have the search functionality in.
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
$LOAD_PATH.unshift(File.dirname('../app/search'))
|
52
|
+
extend SearchModule
|
53
|
+
@search = Search.find_by_search_id(1)
|
54
|
+
if @search.search != nil
|
55
|
+
search()
|
56
|
+
end
|
57
|
+
```
|
58
|
+
|
59
|
+
This is still a work in progress, so if there is any issues, please report them on the GitHub page.
|
60
|
+
|
61
|
+
|
29
62
|
## Contributing
|
30
63
|
|
31
64
|
Bug reports and pull requests are welcome on GitHub at https://github.com/micahnico/search_rails.
|
@@ -33,5 +66,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/micahn
|
|
33
66
|
|
34
67
|
## License
|
35
68
|
|
36
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
37
|
-
|
69
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/search_rails/version.rb
CHANGED