简体   繁体   English

Rails 3.1堆栈级别太深

[英]Rails 3.1 Stack level too deep

Ironically i would like some feed back on a Stack level too deep error! 具有讽刺意味的是,我想在Stack级别上反馈一些太深的错误!

I've been looking through my code for hours and can't figure out what's wrong! 我已经看了几个小时的代码,无法找出问题所在! It occurs when I try to load a javascript-file that is located in the welcome folder, and this is how the code looks like this: 它发生在我尝试加载位于欢迎文件夹中的javascript文件时,这就是代码如下所示:

application.html.erb: application.html.erb:

<!DOCTYPE html>
<html>
<head>
  <title>Project1</title>
  <%= stylesheet_link_tag "application" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>

</head>
<body>

<%= yield %>
</body>
</html>

index.html.erb: index.html.erb:

<!DOCTYPE html>
<div id="wrapper">
  <div id="header" >
    <div id="Lorem">
      <b>Lorem
    </div>
    <div id="Ipsum">
      <b><p>Ipsum</p>
    </div>
  </div>
  <div id="menuwrapper">
    <div class="tabArea">
      <%= link_to 'Link', {:action => 'update', :controller => 'welcome'},{:class=>"tab",:remote=>true} %>
    </div>
  </div>
  <div id="wrapper2">
  </div>
</div>

welcome_controller.rb: welcome_controller.rb:

#coding:utf-8
class WelcomeController < ApplicationController  
  def index

  end
  def update
    respond_to do |format| format.js { render :update => update} end
  end
end

update.js.erb: update.js.erb:

$(alert("Hello"));

routes.rb: routes.rb中:

  get "welcome/index"
  get "welcome/update"

Eternally grateful for any ideas of whats causing the overflow! 永远感激任何导致溢出的想法! Thanks you. 谢谢。

/Peter /彼得

Backtrace: http://i.imgur.com/b503D.png Backtrace: http//i.imgur.com/b503D.png

Per comments earlier, 根据之前的评论,

Rails is being told to render the update action when rendering for JS format on the update action. 正在告诉Rails在update操作上呈现JS格式时呈现update操作。 The offending code is: 违规代码是:

{render :update => update}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM