Freefind Rails
Easy way to use freefind.com search service in your Rails app. You need to create an account at freefind.com first.
Installation
Add this line to your application's Gemfile:
gem 'freefind_rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install freefind_rails
Include the javascript into the asset pipeline: /app/assets/javascripts/application.js
//= require freefind
Usage
Add the _freefind_search.html.haml view partial where you want the search input box to appear
= render partial: '/freefind_search', locals: { freefind_site_id: your-id }
Make sure to pass your freefind site id into the partial as a local variable. This can be done in the parent application by hardcoding it directly or by using a Rails configuration file.
Add the _freefind_onpage_results.html.haml view partial to the same page if you want search results to populate into that same page instead of in a new page.
= render partial: '/freefind_onpage_results'
Contributing
- Fork it ( https://github.com/[my-github-username]/freefind_rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request