In controller code...

require 'rubygems'
require 'mechanize'



class GoogleController < ApplicationController
def index
agent = Mechanize.new
page=agent.post(" ")

search_form = page.form_with('form1')
search_form.DropDownList2 = 'BAGBAHARA'
search_form.txtSearch = 'a'
search_form.drpMatch = 'Starting With'
@search_results=agent.submit(search_form)
puts page.parser.to_html
puts page.search("//*[(@id = 'dgrSearch')]")
end
end

in views

<%=@search_results.body%>