Forum: Ruby on Rails 2.2 rc1 - local object name on partial (:as)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
80e664940ea1b3ff78bad3a248108241?d=identicon&s=25 Wagner Narde (Guest)
on 2008-11-01 17:19
(Received via mailing list)
Hi guys,

The same functionality implemented on #509 (:as option to local var on
partial) is not available on JavaScriptGenerator method insert_html/
replace_html.

render :partial => 'exercises/_sortable_exercise', :as =>
'exercise', :collection => @exercises

Works! I get an 'exercise' object, as expected. But...

page.insert_html :bottom, "exercises", :partial => 'exercises/
_sortable_exercise', :as => 'exercise', :object => @exercise

I still get the same 'sortable_exercise' object instead of 'exercise'.

Am I doing something wrong?

Rgds,
Wagner Narde
This topic is locked and can not be replied to.