首页 > 代码库 > rediect_to @team 时出现的问题

rediect_to @team 时出现的问题

@team = Team.new(params[:team])

redirect_to @team

提示:

undefined method `team_url‘ for 

原来是routes.rb中写错了。resources :teams 写成了
resource :teams

!!!!!!!

http://stackoverflow.com/questions/9194767/difference-between-resource-and-resources-methods

附上 两个写法的区别。

rediect_to @team 时出现的问题