Ajax调用在rails中渲染js?

时间:2014-02-27 17:22:41

标签: javascript jquery ruby-on-rails ajax coffeescript

这是我的日志::

Started GET "/emain" for 127.0.0.1 at 2014-02-27 22:36:11 +0530
Processing by EmployeeController#emain as HTML
Emp Load (1.0ms)  SELECT "emps".* FROM "emps" WHERE "emps"."id" = 2 ORDER BY "
emps"."id" ASC LIMIT 1
Rendered employee/_emp.js.erb (0.0ms)
Rendered employee/_form.html.erb (9.0ms)
Rendered employee/_content.html.erb (14.0ms)
Rendered employee/emain.html.erb within layouts/application (22.0ms)
Rendered layouts/_flash.html.erb (1.0ms)
Completed 200 OK in 55ms (Views: 53.0ms | ActiveRecord: 1.0ms)


Started GET "/assets/logo.png" for 127.0.0.1 at 2014-02-27 22:36:11 +0530

_form.html.erb我已包含部分

<%= render(:partial => "emp.js") %>

_emp.js.erb

<script type='text/javascript'>...
</script>

在重新加载/emain时它运行正常,但错误是:当调用此(下面)函数(in coffeescript)时,它显示上面给出的负载,但js是不工作

$(document).ready ->
  $(".click").mouseenter ->
    $(".content-wrapper").load "emain #eform"
   return
return

0 个答案:

没有答案