Commit 4e6825a7 authored by 神楽坂玲奈's avatar 神楽坂玲奈

继续修复注册问题,去除devise

parent e4326515
...@@ -61,8 +61,8 @@ class UsersController < ApplicationController ...@@ -61,8 +61,8 @@ class UsersController < ApplicationController
def create def create
@user = User.new(params[:user]) @user = User.new(params[:user])
#不知道什么原因,加了devise之后那两个字段就奇怪的变成空了 #不知道什么原因,加了devise之后那两个字段就奇怪的变成空了
@user.name = params[:user][:name] #@user.name = params[:user][:name]
@user.password = params[:user][:password] #@user.password = params[:user][:password]
@actions = [User.human_attribute_name(:register)] @actions = [User.human_attribute_name(:register)]
respond_to do |format| respond_to do |format|
if @user.save if @user.save
......
...@@ -3,10 +3,10 @@ class User < ActiveRecord::Base ...@@ -3,10 +3,10 @@ class User < ActiveRecord::Base
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, # :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable # :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, #devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable # :recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model # Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me #attr_accessible :email, :password, :password_confirmation, :remember_me
has_attached_file :avatar, :styles => { :middle => ["120x120#", :png], :small => ["48x48#", :png] }, :default_url => lambda { |avatar| "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(avatar.instance.email.strip.downcase)}?size=#{120}" } has_attached_file :avatar, :styles => { :middle => ["120x120#", :png], :small => ["48x48#", :png] }, :default_url => lambda { |avatar| "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(avatar.instance.email.strip.downcase)}?size=#{120}" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment