我是 ruby 新手,喜欢语法!但是我一直收到这个错误,有人可以告诉我为什么吗?我也确实尝试将它包含在 include ActiveModel::Validations 中,但没有任何运气。让这个“堆栈级别太深”
class HomeController < ApplicationController
def index
if params[:username]
l = Users.new(:username => params[:username], :password => params[:password], :email => params[:email]).save
z = Users.where(:username => params[:username]).limit(1).last
@debugging = "Howdy" + z[:username] + ""
end
end
end
用户型号:
class Users < ActiveRecord::Base
validates :username, :presence => true
attr_accessible :email, :password, :username
end