[Rails] Re: repeated methods in rjs

2010-02-12 Thread Frederick Cheung
On Feb 11, 7:46 pm, Greg Donald wrote: > On Thu, Feb 11, 2010 at 1:33 PM, Marnen Laibow-Koser > Because I build more than just toy apps.  Sometimes I have complex > logic for what effect to show, or what to do when an exception is > raised.  Sometimes the JS is generated, like: > > page << "$j(fun

Re: [Rails] Re: repeated methods in rjs

2010-02-11 Thread Chris Habgood
Thanks. I was not sure if there was a totally transparent way to do. On Thu, Feb 11, 2010 at 3:41 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Feb 11, 4:57 pm, Me wrote: > > Is there a way to use any kind of helper or something if you do the > > same thing on every rjs cal

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Frederick Cheung
On Feb 11, 4:57 pm, Me wrote: > Is there a way to use any kind of helper or something if you do the > same thing on every rjs call?  Like render a flash box div? if in a helper you stick something like def rjs_flash update_page do |page| ... end end Then in your templates you can do

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Me
Ok, does anyone know how to do a page[:div].replace_html on every ajax call, helper or something like that? On Feb 11, 1:15 pm, Greg Donald wrote: > On Thu, Feb 11, 2010 at 12:58 PM, Marnen Laibow-Koser > > wrote: > > Why do you prefer RJS to writing JavaScript? > > RJS is a template rendering s

Re: [Rails] Re: repeated methods in rjs

2010-02-11 Thread Greg Donald
On Thu, Feb 11, 2010 at 12:27 PM, Marnen Laibow-Koser wrote: > Chris Habgood wrote: >> " Why do you need RJS? " >> >> It is an ajax call > > That doesn't require RJS. Why the war on RJS? It's been working great for me since Rails 0.8. -- Greg Donald destiney.com | gregdonald.com -- You rece

Re: [Rails] Re: repeated methods in rjs

2010-02-11 Thread Chris Habgood
"That doesn't require RJS." Ok, this is an early build out I do not want updates in the controller ase may have additional stuff in the future and i do not want the controller cluttered up. On Thu, Feb 11, 2010 at 12:27 PM, Marnen Laibow-Koser wrote: > Chris Habgood wrote: > > " Why do you need

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Marnen Laibow-Koser
Chris Habgood wrote: > " Why do you need RJS? " > > It is an ajax call That doesn't require RJS. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Me
" Why do you need RJS? " It is an ajax call On Feb 11, 12:04 pm, Marnen Laibow-Koser wrote: > For the second time: please quote when replying! > > Chris Habgood wrote: > > Ok, how would I implement the manual JS version to get called > > automatically on every rjs render? > > Why do you need RJS

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Marnen Laibow-Koser
For the second time: please quote when replying! Chris Habgood wrote: > Ok, how would I implement the manual JS version to get called > automatically on every rjs render? Why do you need RJS? Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-for

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Me
Ok, how would I implement the manual JS version to get called automatically on every rjs render? On Feb 11, 11:56 am, Marnen Laibow-Koser wrote: > Please quote when replying -- otherwise we don't know what you're > responding to. > > Chris Habgood wrote: > > It is a full ajax site.  flash gets re

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Marnen Laibow-Koser
Please quote when replying -- otherwise we don't know what you're responding to. Chris Habgood wrote: > It is a full ajax site. flash gets rendered on every call, nothing > in it if it is empty anyway. So what? That's irrelevant to the advice I gave, isn't it? Best, --  Marnen Laibow-Koser h

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Me
It is a full ajax site. flash gets rendered on every call, nothing in it if it is empty anyway. On Feb 11, 11:06 am, Marnen Laibow-Koser wrote: > Chris Habgood wrote: > > Is there a way to use any kind of helper or something if you do the > > same thing on every rjs call?  Like render a flash b

[Rails] Re: repeated methods in rjs

2010-02-11 Thread Marnen Laibow-Koser
Chris Habgood wrote: > Is there a way to use any kind of helper or something if you do the > same thing on every rjs call? Like render a flash box div? Why not write JavaScript directly in unobtrusive style, and call the appropriate function as necessary? Best, --  Marnen Laibow-Koser http://ww