Ruby on Rails
Thursday, November 25, 2010
hey Vineeth,
As mentioned by others about understand the concept of partial first thats true.
But the collection object can be accessable by the name of partial in you case you can access using "<%= form.attribute_name %>"
<%= "render :partial => '/comment/form', :collection=>@blog.comments" %>
But if in-case you don't want the object name "form" then you can parse "as => object_name" while calling partial. there are few more options like "form_counter" etc if you want to display it.
Thanks
Abhis
On Fri, Nov 26, 2010 at 11:38 AM, Vineeth Pradhan <lists@ruby-forum.com> wrote:
"Виталий Янчук" <mail@vitalik.com.ua> wrote in post #963883:
> Yes, you would better read about that.>> Colin
> But I will answer, in partial you would be able to access to the item by
> accessing variable named by the name of the partial, in your case "form"
>
> On Thu, Nov 25, 2010 at 2:03 PM, Colin Law <clanlaw@googlemail.com>
> wrote:
>
>>
>>
>
>
> --
Thanks you!
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment