Forum: Ruby on Rails ActiveRecord question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
98872bd7af9f6b8238bfa06d784cf6a7?d=identicon&s=25 Gros Gros (gros)
on 2005-12-16 13:32
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 ?
This topic is locked and can not be replied to.