1
在我的應用程序中,我需要爲所有format.js
和format.htm
響應設置一些deafult操作。在這一刻,我在所有的控制器是這樣的:Rails 3爲響應設置默認操作
def index
@users = User.all
respond_to do |format|
format.html {html_response}
format.js {js_response}
end
end
但我認爲,這不是一個很好的解決方案。我能做什麼?
以及如何做'html_response'和'js_response'目光從打電話了嗎? – nathanvda 2011-04-28 12:38:11