Am 31.08.2008 um 22:54 schrieb Manuel Wiedenmann:

Hallo Manuel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

@svasset.clients << @client
@svasset is das nil object...

du solltest es vielleicht so machen:
@client = Client.new(params[:client])
@client.svasset = @client.id

client ja aber svasset
legt er leider nicht an..nix leeres .. gar nix..

mhh



manuel

Am 31.08.2008 um 22:47 schrieb Werner Laude:

Hallo ich bin mit Rest Sachen etwas am verzweilfeln....

class Client < ActiveRecord::Base
has_one :svasset

class Svasset < ActiveRecord::Base
belongs_to :client

map.resources :clients,  do |client|
   client.resource :svassets
 end

Anzeigen funktioniert soweit , aber ich bekomme folgendes nicht hin:

Bei Neuanlage eines Client soll eine Svasset erstellt werden mit der client_id

def new
   @client = Client.new
 end

 def create
   @client = Client.new(params[:client])
   @svasset.clients << @client
   respond_to |wants|
   flash[:notice] = 'Client was successfully created.'
   wants.html redirect_to(@client)
 end

You have a nil object when you didn't expect it! The error occurred while evaluating nil.clients
Gruß



Werner Laude
Lindenburger Allee 22  -  50931 Köln

0221.8805 635

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://www.webagentur-laude.de

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFIuwUXs/WwCK0ZZEARAs3FAJ9GPqjKG46b+1vwDtTnE4fRZfpeogCgmUyB
whTfF1bI+4yIJ0D2bChYDbc=
=5O2A
-----END PGP SIGNATURE-----
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug


_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

Antwort per Email an