In my index.html.erb page when data is queried from MSSQL it get displayed as
Me&Mine. I tried this:
$("#3").text("<%= escape_javascript(raw render(:partial => "var") %>");
but it doesn’t work.
index.html.erb :
<%= link_to "Link", {:action => "AjaxView",:col => "colname"},
:update => "Ajaxcall", :remote => true %>
<tr>
<td id="#3" style="height:25px">data displayed here</td>
Controller:
def AjaxView
@vars= Var.find(:all,:conditions => { :varName=> "one" },:select=>(params[:col]))
respond_to do |format|
format.js { render :layout=>false }
end
end
AjaxView.js.erb:
if ( @col.to_s == "colName") {
$("#3").text("<%= escape_javascript(render(:partial => "var") %>");
}
elsif ( @col.to_s == "colName1")
{
$("#2").text("<%= escape_javascript(render(:partial => "var") %>");
}
_var.html.erb:
<%= var.col1 %>
How can I display Me&Mine instead of Me&Mine?
Have you tried using html_safe on it?