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 -- Posted via http://www.ruby-forum.com/.
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, > JohnYour 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. -- Posted via http://www.ruby-forum.com/.
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.-- Posted via http://www.ruby-forum.com/.