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
Gracias de antemano!
preguntado el 28 de agosto de 11 a las 04:08