[Rails] Re: Accessing non-instance variables in view

2012-12-19 Thread snappa
$.colorbox({html:%= @x %, width:35%,height:400px}); Assuming that the line of jquery code is executed client side and operates on the HTML returned from the Ajax request you will not have access to the instance variable. It will have been rendered in the returned HTML on the server. You

[Rails] Re: Accessing non-instance variables in view

2012-12-18 Thread Praveen BK
Ya, thank you,adding @ to variable made it available in the view. here, I m making HTTP request using ajax, which goes to my controller and executes a method, Now I m getting return value in view. But I have to display it in popup menu. the code for the pop up is $.colorbox({html:%= @x %,

[Rails] Re: Accessing non-instance variables in view

2012-12-17 Thread Praveen BK
Adding @ to a variable doesn make the variable instance variable, its convention that are followed while writing a ruby program, I think... Here I have a variable x = 10, in my controller how can i access it in view without using cookies. -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Accessing non-instance variables in view

2012-12-17 Thread Praveen BK
Adding @ to a variable doesn make the variable instance variable, its convention that are followed while writing a ruby program, I think... Here I have a variable x = 10, in my controller how can i access it in view without using cookies. -- Posted via http://www.ruby-forum.com/. -- You

Re: [Rails] Re: Accessing non-instance variables in view

2012-12-17 Thread Colin Law
On 18 December 2012 05:10, Praveen BK li...@ruby-forum.com wrote: Adding @ to a variable doesn make the variable instance variable, its convention that are followed while writing a ruby program, I think... Here I have a variable x = 10, in my controller how can i access it in view without