I have to modify a search in the home page of a site. The code is written in Ruby language and used "Rails" frame work.
***Image******

Here, there is already an option for search with mail id. But there is an id field too. Need to implement multiple search.
Already written code of "view" (MVC architecture):-
<form action="/users/search" method="POST">
<label for="email">Email</label>
<input type="text" name="email" />
<input type="submit" name="search" value="Search" />
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" />
</form>
Already written code of its "controller" (MVC architecture):-
def search
@users = User.paginate(
:conditions => ["email LIKE ?", '%' + params[:email] + '%'],
:page => params[:page], :per_page => 25,
:order => params[:order].nil? ?
:email : params[:order].gsub('-', ' ')
)
if @users.length == 1
redirect_to edit_user_path(@users.first)
else
render "index"
end
end
Please help me to use multiple search with the condition in controller file satisfying these:-
Search with id
- Search with email (already written)
- Search with email and id