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
on 2012-12-12 14:21
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.