ActiveRecord question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ActiveRecord question

gros gros
The context:
project HABTM tags
tags HABTM project

In a controller i do the following
@project = Project.new
@tag = Tag.new

So I have now a new project and a new tag, but nothing is created in the
database.

When I do @project.tags << @tag the tag is added to the database. I
don't want this behaviour.

What I want is a @project with @tags inside but nothing into the
database.
Data should be saved only when I do @project.save.
How can i do ?

--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails