0
我有有一个方法控制器称为历史路由URL和路径在轨
class UsersController < ApplicationController
def history
User.return_history(params[:id])
end
end
我已经在我的routes.rb文件下列
map.resources :users, :shallow => true do |user|
user.resources :friends, :shallow => false
user.resources :posts, :collection=>{:no_access => :get}
user.resources :photos
end
如何尝试Ajax调用users_controller.rb
的历史方法?以下列方式
link_to_remote 'History', :url=>history_user_path(@user), :update=>"history", :method=>'get'
使用link_to_remote
扔下我一个错误说history_user_path()
没有找到。怎么会这样? edit_user_path()
显示没有错误,编辑甚至未在User.rb文件中明确定义。谢谢。