# Question about Mapping from Forms

**URL:** <https://www.ruby-forum.com/t/question-about-mapping-from-forms/56199>\
**Category:** Rails\
**Created:** [March 28, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/question-about-mapping-from-forms/56199 "2006-03-28T22:37:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@Brent\_J](https://www.ruby-forum.com/u/Brent_J)\
**Post date:** [March 28, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/question-about-mapping-from-forms/56199/1 "2006-03-28T22:37:45Z")

</div>

During a load or save in my controller I’ve manually been doing:  
@myobject = MyObject.find(:first, :conditions =\> “id =  
#{@params[‘id’]}”)

If I’m updating an existing object I load it, change stuff using  
something like myobject.name = “@params[‘name’]”, etc etc, then call  
save. That’s what I’ve done in similar situations for ages in other  
development languages. But, I had the urge to go back and look at  
some of the online tutorials, where I noticed references like this:

So it appears as though Rails can automagically populate an object  
which can then be referred to with something like:

@myobject = @params[‘myobject’]

At least that’s what it SEEMS like. But if I define a select like:

.... code to loop through options setting value to myobject ids ...

I just have that, and a submit button. I have the @myobject =  
@params[‘myobject’] in the resulting controller, but if I try and view  
@myobject.id in the view I get something like “-606936886” which is  
definitely not valid.

Can rails load the object up for me or should I just go back to doing  
the find() calls? Using myobject[property] to name inputs for calling  
a scaffolded update() seems to work just fine.

I’d appreciate any little bit of info you may have.

Thanks!

- Brent
