I have the following method that gets called via AJAX request when user hits a button on my page.
def savings_easter_egg
@savings = params[:savings] if params[:savings]
return render :partial => "topics/savings", :locals => { :savings => @savings }
end
I want this method to return a partial that can be displayed in JqueryUI's modal.
$.ajax({
type: 'GET',
url: '/topics/savings_easter_egg',
data: {
savings: data[key]['saving']
} ,
success: function(response) {
$(response).dialog({
height: 840,
modal: true,
});
}
});
As shown above, I'm trying to use the response from my controller to generate the dialog, but I'm not sure about this. The documentation confuses me a bit: http://jqueryui.com/dialog/#modal
topics/_savings_easter_egg.slim
#dialog-modal
p Hi
= params[:savings]
= @savings
This is the partial that I want to pass and display in the modal. Right now, I'm getting a modal tos how, but it is a thin white line with no text. What am I doing wrong?