只显示主题贴

比较赞同= =虽然以前没这么想过~
theone 写道wiisola 写道theone 写道update_all ["password =?", password], ['id=?,1] 那如何更新多个字段呢?第1个参数传hash好象不行。。 这样写 update_all ["username = ?, password =?", username, password], ['id=?',1] 谢谢,不过我找到办法了 validates_length_of :password, :in => 6..20, :allow_nil => true 原来allow_nil是这么个意思阿,以前误解了...
  • 进入论坛 Ruby
不见得 写道update_attribute(s) 我本来就是用的这个 @user.update_attributes(:email => params[:user][:email], :im => params[:user][:im]) 但是修改的时候会校验password,是通不过的,我就是想问有什么办法
  • 进入论坛 Ruby
theone 写道update_all ["password =?", password], ['id=?,1] 那如何更新多个字段呢?第1个参数传hash好象不行。。
  • 进入论坛 Ruby
我照Agile Web Development with Rails里第11章用户管理的做了,用了password这个虚拟字段。 user.rb中的部分代码: validates_length_of :password, :in => 6..20 def password @password end def password=(pwd) @password = pwd returen if pwd.blank created_new_salt self.hashed_password = User.encrypted_password(self.pa ...
  • 进入论坛 Ruby
是指界面的还是程序里的? 是界面的话设置个jdk平台中文字体 是代码中的话有部分字体是不能正确显示汉字的
  • 进入论坛 Ruby
wiisola
搜索本博客
最近加入圈子
存档
最新评论