search_rails 1.1.3 → 2.0.0
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 +5 -5
- data/.github/dependabot.yml +15 -0
- data/.github/workflows/ci.yml +38 -0
- data/.gitignore +30 -9
- data/.node-version +1 -0
- data/.npm-version +1 -0
- data/.prettierignore +2 -0
- data/.rspec +1 -2
- data/.rubocop.yml +130 -0
- data/.ruby-version +1 -0
- data/.tool-versions +3 -0
- data/Gemfile +19 -6
- data/Gemfile.lock +398 -0
- data/LICENSE +19 -0
- data/README.md +2 -80
- data/Rakefile +3 -4
- data/VERSION +1 -0
- data/lib/search.rb +667 -0
- data/lib/search_rails.rb +11 -529
- data/package-lock.json +14 -0
- data/package.json +7 -0
- data/search_rails.gemspec +18 -24
- metadata +46 -46
- data/.travis.yml +0 -5
- data/CODE_OF_CONDUCT.md +0 -74
- data/LICENSE.txt +0 -21
- data/bin/console +0 -14
- data/bin/search:install +0 -5
- data/bin/search:install:devise +0 -5
- data/bin/setup +0 -8
- data/lib/search_rails/version.rb +0 -3
data/README.md
CHANGED
@@ -1,81 +1,3 @@
|
|
1
|
-
#
|
1
|
+
# code-ruby
|
2
2
|
|
3
|
-
A
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'search_rails'
|
11
|
-
gem 'colorize'
|
12
|
-
```
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
|
16
|
-
$ bundle install
|
17
|
-
|
18
|
-
## Usage
|
19
|
-
|
20
|
-
To install the search functionality not using Devise, type the command:
|
21
|
-
|
22
|
-
$ search:install
|
23
|
-
|
24
|
-
To install the search functionality using Devise, type the command:
|
25
|
-
|
26
|
-
$ search:install:devise
|
27
|
-
|
28
|
-
Then follow the steps below.
|
29
|
-
|
30
|
-
The syntax for installing the search function is shown in the example below,
|
31
|
-
as if you are installing it for the table 'humans' and the attributes 'name' (string) and 'age' (integer):
|
32
|
-
|
33
|
-
$ install humans name:string age:integer
|
34
|
-
|
35
|
-
After that run:
|
36
|
-
|
37
|
-
$ rake db:migrate
|
38
|
-
|
39
|
-
Then insert the following form on whatever page you have set up for the search function:
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
<%= form_for @search do |f| %>
|
43
|
-
<%= f.text_field :search %>
|
44
|
-
<%= link_to 'x', clear_search_path(@search) %>
|
45
|
-
<% end -%>
|
46
|
-
```
|
47
|
-
|
48
|
-
|
49
|
-
If you are not using Devise, add the following lines to whatever controller action you want to have the search functionality in.
|
50
|
-
|
51
|
-
```ruby
|
52
|
-
$LOAD_PATH.unshift(File.dirname('../app/search'))
|
53
|
-
extend SearchModule
|
54
|
-
@search = Search.find_by_search_id(1)
|
55
|
-
if @search.search != nil
|
56
|
-
search()
|
57
|
-
end
|
58
|
-
```
|
59
|
-
|
60
|
-
If you are using Devise, add the following lines to whatever controller action you want to have the search functionality in.
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
$LOAD_PATH.unshift(File.dirname('../app/search'))
|
64
|
-
extend SearchModule
|
65
|
-
@search = Search.find_by_user_id(current_user.id)
|
66
|
-
if @search.search != nil
|
67
|
-
search()
|
68
|
-
end
|
69
|
-
```
|
70
|
-
|
71
|
-
This is still a work in progress, so if there are any issues, please report them on the GitHub page.
|
72
|
-
|
73
|
-
|
74
|
-
## Contributing
|
75
|
-
|
76
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/micahnico/search_rails.
|
77
|
-
|
78
|
-
|
79
|
-
## License
|
80
|
-
|
81
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
3
|
+
A programming language
|
data/Rakefile
CHANGED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|