Hi,

 I am fetching a set of data from the controller. The data set is in a
cookie array. I have to display the set in a modal pop up. I am sending
the request through an ajax call. How to display the array from the
controller in the view in ajax in a modal box? I am using colorbox as my
modal box.


.erb file:

$(document).ready(function() {
var currentCellText;/*this variable will have the clicked cell value*/
$(".inline").click(function(e) {
currentCellText = $(this).text();

$.ajax({
  type: 'GET',
  url:'/leave',
  async: false,
  data:{ foo1:currentCellText
        },
  success:function(data){
$.colorbox({html: <%= cookie[:event] %>,  width:"35%",height:"400px"});
},
error:function(data){
        alert("Failure");
}
});

});

});

controller file:

cookie[:event] is having the data array.

If I print the cookie[:event] in the controller using a puts, I get the
data set. But I am not able to achieve the same in the ajax modal box.


Regards,
Nikhil

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to