首先,我想说我是铁路上的菜鸟.
我的注册页面,使用设计(rails),不显示不同密码的错误,它只是不创建用户,但也不显示错误消息.
<div class="module" style="padding:15px 25px 0px 25px;">
<div style="float:right; width:100%; padding-left:30px; border-left:1px solid #e2e2e2;">
<%= form_for("user", :as => resource_name, :url => registration_path("user")) do |f| %>
<p>
Usuario: <br />
<%= f.text_field :username, :style => "font-size:2.0em", :autocomplete => "off" %><br />
</p>
<p>
Email: (apenas emails @usp.br sao aceitos) <br />
<%= f.text_field :email, :style => "font-size:2.0em", :autocomplete => "off" %><br />
</p>
<p>
Senha:<br />
<%= f.password_field :password, :style => "font-size:2.0em", :autocomplete => "off" %><br />
</p>
<p>
Confirmar …Run Code Online (Sandbox Code Playgroud) 我在尝试添加值名称时遇到错误设计,我认为所有事情都做了所有工作,但它不起作用.
NoMethodError in Devise/registrations#new
undefined method `name' for #<User:0x00000002e4e038>
Run Code Online (Sandbox Code Playgroud)
这是我的用户模型:
class User < ActiveRecord::Base
include Gravtastic
gravtastic :size => 165, :filetype => :png, :rating => 'R'
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
validates :email, :username, :presence => true, :uniqueness => true
# Setup accessible (or protected) attributes for your model
attr_accessible :name, :username, :email, :password, :password_confirmation, :remember_me
has_many :topics, :dependent => :destroy …Run Code Online (Sandbox Code Playgroud)