I am using ruby 1.9.3p194 and rails 3.2.5 when i do
@authors = Author.all
it works fine by outputing all name from my database. But
@authors = Author.where("name like ?", "%#{params[:q]}%")
is not working. I am using Mongodb. I want to output the name(Ram) when i input R. What could be the solution?
By this method i can search params[:q] through my field :name only. How can i add other field name also such i want to seach this params[:q] in text field :role , :email also at once? I used || but it gives error. I have to write this in comment but since my comment list is long . I ask this question here. Sorry for that.