When doing RJS stuff of the form below, I seem to recall unexpected
behavoir where if I had many method calls within that block things
didn''t work as expected and variables would not have values I
expected. I know I am not being very specific and I don''t have an
example. I am trying to refactor some code where I have alot of code
inside the block and I am affraid I am going to have the same sort of
problem I used to have previously when I had written alot of RJS stuff
previously.
render :update do |page|
...
end
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Bill Walton
2011-May-31 22:39 UTC
Re: is there something peculiar about a render :update block ?
Hi Jedrin, On Tue, May 31, 2011 at 5:11 PM, Jedrin <jrubiando-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > When doing RJS stuff of the form below, I seem to recall unexpected > behavoir where if I had many method calls within that block things > didn''t work as expected and variables would not have values I > expected. I know I am not being very specific and I don''t have an > example. I am trying to refactor some code where I have alot of code > inside the block and I am affraid I am going to have the same sort of > problem I used to have previously when I had written alot of RJS stuff > previously. > > render :update do |page| > ... > endI tend to use render :update from within the controller in cases where there are a small number (like 4 max) of method calls. Beyond that, I think it improves readability and testability to move the method calls to an rjs template. Best regards, Bill -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.