I am tryign to access the rjs page element from my controller but i get the following error: undefined local variable or method `page'' for #<DptController:0x6e85750> TIA -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Radiya Sojitrawala wrote:> I am tryign to access the rjs page element from my controller > but i get the following error: > > undefined local variable or method `page'' for #<DptController:0x6e85750> > > > TIAThat method is only there if you are inside an RJS template or a render(:update) block. If you want you controller to render RJS, try this: render(:update) do |page| page[''some_id''].do_something end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Alex Wayne wrote:> Radiya Sojitrawala wrote: >> I am tryign to access the rjs page element from my controller >> but i get the following error: >> >> undefined local variable or method `page'' for #<DptController:0x6e85750> >> >> >> TIA > > That method is only there if you are inside an RJS template or a > render(:update) block. If you want you controller to render RJS, try > this: > > render(:update) do |page| > page[''some_id''].do_something > endThanks Alex, I am new to ruby, rails and rjs. Is there a simple and complete tutorial on this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---