Forum: Ruby on Rails I don't get why my model isn't saving - assistance requested

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8117d5394c8e517529feed4b66ae3075?d=identicon&s=25 Wayne Molina (waynem)
on 2008-10-22 01:36
(Received via mailing list)
I'm trying to do something relatively basic.  I'm using the restful
authentication plugin, so I have Users, and I also have Tasks which
belong to a user:

class User < ActiveRecord::Base
   has_many :assigned_tasks, :class_name => "Task", :foreign_key =>
   has_many :created_tasks, :class_name => "Task", :foreign_key =>

class Task < ActiveRecord::Base
   belongs_to :creator, :class_name => "User", :foreign_key =>
   belongs_to :user, :class_name => "User", :foreign_key =>

I'm using Rails 2.1.1 so I'm doing this in the view:

# new.html.erb
<% form_for @task do |f| %>
... fields
<% end %>

But the application posts to the index action, not the create action
like it's supposed to; even if I try to post a blank form, when errors
should be raised, it's posting without raising any errors whatsoever.
The new action in the controller reads like this:

def new
   @task =

and here's the create action:

def create
   @task =[:task])
     flash[:notice] = "Task was created"
     redirect_to task_path(@task)
     render :action => 'new'

Can someone let me know what I'm doing wrong?  Should I not be
creating the task with build?  I thought I was getting pretty decent
with the basics of Rails, but I guess not because something this
simple is tripping me up.
8117d5394c8e517529feed4b66ae3075?d=identicon&s=25 Wayne Molina (waynem)
on 2008-10-22 02:27
(Received via mailing list)
Okay... I have no idea what the problem was, but it seems to be
working right now.
F9bdba6e1c8a28664e99e9c8caaa05bd?d=identicon&s=25 Ami (Guest)
on 2008-10-22 05:17
(Received via mailing list)
if you do! it should show you where it fails
Ac95d8758026b818881ed564fd5bb9bb?d=identicon&s=25 Levente Bagi (Guest)
on 2008-11-05 00:03
(Received via mailing list)
I had the same problem, restarting the server helped.
This topic is locked and can not be replied to.