On Dec 5, 8:08 pm, kevin cline
<kevin.cl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Probably asked and answered, but...
>
> Why are controller instance variables visible in the block passed to
> render :update, but controller private methods are not?
>
Because at the end of the day it''s the same as rendering any old
template: instances variables are copied across into a magic object,
which is not the controller (and so controller private methods are not
available)
Fred
> This does not work:
>
> class MyController < ApplicationController
> def some_action
> render :update do |page|
> page.replace_html ''element'', some_data # some_data
is not
> defined
> end
> end
>
> private
> def some_data
> ...
> end
> 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-/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?hl=en
-~----------~----~----~----~------~----~------~--~---