I've created a simple user system with authlogic using Rails 3. I want to add an "account_type" column to the database. How can I populate this column in the database when the user signs up? I have very very little experience with Rails.
Update: So I know somewhere in "@user = User.new(params[:user])" I need to add :account_type = "user". What's the right syntax for this though?
Here's what I have in my user controller:
class UserController < ApplicationController
   before_filter :require_no_user, :only => [:new, :create]
   def new
     @user = User.new
   end
   def create
     @user = User.new(params[:user])
     if @user.save
       flash[:notice] = "Registration successful!"
       redirect_to root_url
   开发者_如何转开发  else
       render :action => :new
     end
   end
 end
Thanks in advance!
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论