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.
data/README.md CHANGED
@@ -1,81 +1,3 @@
1
- # SearchRails
1
+ # code-ruby
2
2
 
3
- A Simple Search Gem For Ruby On Rails
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
@@ -1,6 +1,5 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
3
2
 
4
- RSpec::Core::RakeTask.new(:spec)
3
+ require "rspec/core/rake_task"
5
4
 
6
- task :default => :spec
5
+ RSpec::Core::RakeTask.new(:default) { |task| task.verbose = false }
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.0.0