--
Cheers!
- Pratik
http://m.onkey.org
I cannot access a controller instance variable in my rjs file
LearnController.rb
1 def page_via_ajax 2 # debugger 3 render :layout => false 4 @my_page_id = "pg_7" 5 end
page_via_ajax.rjs
1 puts("in page_via_ajax.rjs") 2 puts("@my_page_id:#{@my_page_id}:")
System output from page_via_ajax.rjs:
in page_via_ajax.rjs @my_page_id:: |
What are the reasons and what is the solution?
Hello.
My rjs cannot obtain the instance variable set up in the associated
controller method. I have described the code in the attached note. Will
appreciate any thoughts on "why". I am using InstantRails with the Rails
version of 2.0.2.
With thanks and regards,
Abbas
Web-site: www.emast.in
Subject: Tutorial on 'Ruby on Rails'