Skip to content

Commit

Permalink
Add Ransack Gem
Browse files Browse the repository at this point in the history
Configure Ransack to use custom search_key :search instead of the
default :q.
  • Loading branch information
Nat York committed Mar 30, 2017
1 parent 433f573 commit 6f0692c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ gem 'kaminari'
# Use Simpleform for forms
gem 'simple_form'

# Use Ransack for creating search forms
gem 'ransack'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ GEM
omniauth (~> 1.2)
parser (2.4.0.0)
ast (~> 2.2)
polyamorous (1.3.1)
activerecord (>= 3.0)
powerpack (0.1.1)
pry (0.10.4)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -201,6 +203,12 @@ GEM
thor (>= 0.18.1, < 2.0)
rainbow (2.2.1)
rake (12.0.0)
ransack (1.8.2)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.3)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
Expand Down Expand Up @@ -307,6 +315,7 @@ DEPENDENCIES
pundit
rails (~> 5.0.1)
rails-controller-testing
ransack
rspec-rails (~> 3.5)
rubocop
sass-rails (~> 5.0)
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/ransack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Ransack.configure do |config|
config.search_key = :search
end

0 comments on commit 6f0692c

Please sign in to comment.