# Form for

**URL:** <https://www.ruby-forum.com/t/form-for/155704>\
**Category:** Rails\
**Created:** [December 15, 2008, 7:20pm UTC](https://www.ruby-forum.com/t/form-for/155704 "2008-12-15T19:20:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpathare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@mpathare](https://www.ruby-forum.com/u/mpathare)\
**Post date:** [December 15, 2008, 7:20pm UTC](https://www.ruby-forum.com/t/form-for/155704/1 "2008-12-15T19:20:26Z")

</div>

I have two models, ladder and statistic  
The relationship is  
ladder has\_many statistics  
statistic belongs\_to ladder

In a view for my ladder controller action show, I am redirecting the  
user to an action in my statistics controller using

\<% form for ladder\_statistics\_path(@ladder) do |f| %\>  
\<%= submit\_tag ‘Create’ %\>  
\<%end%\>

I would think that in the statistics controller the object @ladder and  
all of its attributes would be available to me, but only the id is  
available in the params hash as params[:ladder\_id]

I have to explicitly call

@ladder = ladder.find(params[:ladder\_id])

in the statistics controller to get @ladder.name

is this normal, or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![mpathare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@mpathare](https://www.ruby-forum.com/u/mpathare)\
**Post date:** [December 15, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/form-for/155704/2 "2008-12-15T21:19:12Z")

</div>

On Mon, Dec 15, 2008 at 1:20 PM, Maulin P. \<  
removed\_email\_address@domain.invalid\> wrote:

> \<%= submit\_tag ‘Create’ %\>  
> in the statistics controller to get @ladder.name
> 
> is this normal, or am I doing something wrong?

That’s the way I learned it, specifically from

> **[Rolling with Rails 2.0 - The First Full Tutorial - Part 1 | AkitaOnRails.com](https://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial)**
>
> for brazilians: click here.
> I am very happy to see that my Rails 2.0 Screencast was very well received. More than 1,500 unique visitors watched it...

.

–wpd
