使用Rails Ajax呈现不同的.js文件

在使用Ajax时如何呈现不同的.js.erb文件?

例如:

  :get, :remote => true do %> 

这将通过UserController#show ,然后呈现users/show.js.erb 。 如何让它通过UserController#show然后渲染users/hello.js.erb

users_controller.rb中

 def show @user = User.find(params[:id]) respond_to do |format| format.js { render 'hello.js.erb' } end end