2
我在我的紅寶石控制器下面的代碼:通過從控制器的陣列,以查看紅寶石
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
,但它只是讓我訪問@mastertest
視圖( index.html.erb
)。我如何將數組傳遞給視圖?