$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>'); if(document.getElementById("course_is_public")) { <% if @course.is_public == 0%> $("#course_is_public").attr("checked",false); <% elsif @course.is_public == 1 %> $("#course_is_public").attr("checked",true); <% end %> }