0

我一直在这个错误上停留了一段时间,我环顾四周,显然这是由于太多end的 's,但我似乎不明白为什么,任何帮助家伙?谢谢。

这是我的代码

class UsersController < ApplicationController
  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])
    if @user.save
      redirect_to root_url, :notice => "Signed up!"
    else
      render "new"
  end
4

1 回答 1

3
class UsersController < ApplicationController
  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])

    if @user.save
      redirect_to root_url, :notice => "Signed up!"
    else
      render "new"
    end # your missed end here
  end
end # another end missed for the class
于 2013-02-22T11:04:59.470 回答