On Mon, Dec 15, 2008 at 1:20 PM, Maulin Pathare <
[email protected]> wrote:

>
> 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?
>
That's the way I learned it, specifically from
http://akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial
.

--wpd

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to