嗨,我正在进行重置密码操作.但点击按钮后我收到此错误:
被称为nil的id,错误地为4 - 如果你真的想要id为nil,请使用object_id
这是我的password_reset_controller
class PasswordResetsController < ApplicationController
layout "sessions"
def new
end
def create
user = User.find_by_email(params[:email])
user.send_password_reset if user
redirect_to root_url, :notice => "#{user.id}Las instrucciones para reestrablecer la contrasena fueron enviadas."
end
end
Run Code Online (Sandbox Code Playgroud)
这是我的用户模型
class User < ActiveRecord::Base
attr_accessible :email, :password, :password_confirmation
has_secure_password
before_save { |user| user.email = email.downcase }
before_save :create_remember_token
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false }
validates :password, presence: true, length: { minimum: 6 …
Run Code Online (Sandbox Code Playgroud) 我在动作表中创建了一个以编程方式定制的uipicker,现在我需要设置一个文本字段,其中包含选择器的选择项.使用datepicker,我得到这样的值:
actionSheetDatePicker.DatePicker.ValueChanged += (s, e) => {
this.lblCheckOut.Text = f.ToString ((s as UIDatePicker).Date);
};
Run Code Online (Sandbox Code Playgroud)
现在我正在尝试用我的UIPickerView做同样的事情,但我没有ValueChanged方法.
有没有人可以帮助我获取用我的选择器选择的项目的价值.
提前致谢.
我有以下代码,以显示用户的一些记录:
= @kid.educations.each do |education|
= education.studies_centre
%br
= education.city_and_country
%br
%small
= education.academic_qualification
%hr
%br
= @kid.certificates.each do |certificate|
= certificate.certificate
%br
= certificate.city_and_country
%br
%small
= certificate.description
%hr
%br
= @kid.works.each do |work|
= work.company
%br
= work.city_and_country
%br
%small
= work.description
%hr
%br
Run Code Online (Sandbox Code Playgroud)
但是在每一条记录之后,我都会得到真实的字样,如下图所示:
我该怎么做才能解决这个问题.在此先感谢您的帮助
我在我的document.ready上有以下代码
$.notify("Your class starts in 15min", "info", {
clickToHide: false,
autoHide: false,
globalPosition: 'top center'
});
Run Code Online (Sandbox Code Playgroud)
但没有任何反应,我只得到文本和信息类型,但自动隐藏和globalposition它不起作用.
我做错了什么.
谢谢你的帮助