Forum: Ruby on Rails passing options for render :update

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.
286d6ad8e765f90cf2e8c3e5a6a31c4e?d=identicon&s=25 John T. (ottawaronin)
on 2006-06-13 22:05
I'm having some issues trying to pass some options into render :update
in my controller:

render :update do |page|
  page['mybox'].visual_effect( :scale, 200, {:scaleContent => false})
end

this should just scale the box, and not the content, however, the
content scales.

I noticed that the following is produced:

$("folder-1").visualEffect("scale", 200, {"scaleContent": false});

I noticed that the scaleContent is in quotes - does that affect the
javascript? In  html, I can get it to work by writing:

<a href="#" onclick = "new Effect.Scale('folder-2', 300, {scaleContent:
false});">click me</a>

** note that scaleContent is not quoted...and this works.

Any ideas?
Maybe I didn't pass in the options correctly in my render :update?

Thanks,
John
Alex Wayne (Guest)
on 2006-06-13 22:12
John john wrote:
> I'm having some issues trying to pass some options into render :update
> in my controller:
>
> render :update do |page|
>   page['mybox'].visual_effect( :scale, 200, {:scaleContent => false})
> end
>
> this should just scale the box, and not the content, however, the
> content scales.
>
> I noticed that the following is produced:
>
> $("folder-1").visualEffect("scale", 200, {"scaleContent": false});
>
> I noticed that the scaleContent is in quotes - does that affect the
> javascript? In  html, I can get it to work by writing:
>
> <a href="#" onclick = "new Effect.Scale('folder-2', 300, {scaleContent:
> false});">click me</a>
>
> ** note that scaleContent is not quoted...and this works.
>
> Any ideas?
> Maybe I didn't pass in the options correctly in my render :update?
>
> Thanks,
> John

Your doing everything right, although it looks as if you prototype.js
may be out of date.  Element.visualEffect("scale", ...) was a recent
addition.

Try doing a "rake update_javascripts" in your app root and then try it
again.
286d6ad8e765f90cf2e8c3e5a6a31c4e?d=identicon&s=25 John T. (ottawaronin)
on 2006-06-13 22:36
Hi,
Yup, I have the latest script.aculo.us and prototype javascripts, tried
updating everything. Still no luck.

Hoping someone else might have seen this and has a solution...

John.

Alex Wayne wrote:
> John john wrote:
>> I'm having some issues trying to pass some options into render :update
>> in my controller:
>>
>> render :update do |page|
>>   page['mybox'].visual_effect( :scale, 200, {:scaleContent => false})
>> end
>>
>> this should just scale the box, and not the content, however, the
>> content scales.
>>
>> I noticed that the following is produced:
>>
>> $("folder-1").visualEffect("scale", 200, {"scaleContent": false});
>>
>> I noticed that the scaleContent is in quotes - does that affect the
>> javascript? In  html, I can get it to work by writing:
>>
>> <a href="#" onclick = "new Effect.Scale('folder-2', 300, {scaleContent:
>> false});">click me</a>
>>
>> ** note that scaleContent is not quoted...and this works.
>>
>> Any ideas?
>> Maybe I didn't pass in the options correctly in my render :update?
>>
>> Thanks,
>> John
>
> Your doing everything right, although it looks as if you prototype.js
> may be out of date.  Element.visualEffect("scale", ...) was a recent
> addition.
>
> Try doing a "rake update_javascripts" in your app root and then try it
> again.
This topic is locked and can not be replied to.