-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
| zero when I feed note.target.to_i to Mob.find. What am I doing
| wrong here?
Not be glib, but first it would seem you''re model code into your view.
Second, i have no idea :) But i would want to know what
note.target.to_i returns for the one that points at 0.
Regs,
Derek
Johan Svensson wrote:
| I have a very strange problem that I simply can''t understand here.
| [
| I want to do this in the rhtml:
|
| <% for note in @raid.notes
| @mob = Mob.find(note.target.to_i)
| -%>
| [show some data]
| <% end -%>
|
| But when I look at the development log I see that this is what it
| tries to do instead when loading @mob::
|
| SELECT * FROM mobs WHERE mobs.id = 0 LIMIT 1
|
| If I do <%= note.target %> it returns the proper value. If I do
| Mob.find(6) it returns the data for mob #6. Yet somehow it turns to
| zero when I feed note.target.to_i to Mob.find. What am I doing wrong
| here?
|
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFDA2aqwwHFeC88e2IRAhH1AJ4mbIMMuNDGADdGdzYkzdwfzEWs7wCgni3K
SFcanmeuiXnBGNFuxVp/Knw=ge2W
-----END PGP SIGNATURE-----