I have the following code in my Ruby Controller :
mastertest_controller.rb
def index
......
@mastertest = connection.execute("select code_ver from mastertest")
result_array = { sometihng }
......
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @mastertest}
format.json { render :json => result_array}
end
But it just allows me to access @mastertest in the view(index.html.erb). How do I pass the array to the view ???