Simple search

I need help with simple search .I worked on railscasts example,but its
not working.
Can anyone give me an example of simple search logic.Thanks in Advance

Use this…


So you’re using SearchLogic?

You want to take a look at the SearchLogic GitHub Readme page:

So in your controller, you’ll want something like:

class UsersController < ApplicationController
def index
@search =[:search])
@users = @search.all

And in the view, SearchLogic comes with built in named scopes to

So let’s say you were working with users. And lets say you want to
search on the username.

<% form_for @search do |f| %>

<%= f.text_field :username_like %>

<%= f.submit 'Search' %> <% end %>

I hope this helps. Let me know if you have any questions.