Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Rails 3使用RJ并在Internet Explorer中工作_Javascript_Ruby On Rails_Ajax_Internet Explorer_Ruby On Rails 3 - Fatal编程技术网

Javascript Rails 3使用RJ并在Internet Explorer中工作

Javascript Rails 3使用RJ并在Internet Explorer中工作,javascript,ruby-on-rails,ajax,internet-explorer,ruby-on-rails-3,Javascript,Ruby On Rails,Ajax,Internet Explorer,Ruby On Rails 3,我有一个rails 3应用程序,它有相当多的ajax功能,非常复杂,除了IE之外,它在每个浏览器中都运行得很好,非常漂亮。虽然我不确定为什么,但我猜它与HTML5有关。以下是为简洁起见编辑的我的部分应用程序 他认为: <li id="category_<%= category.id %>"> <%= link_to "#{category.title}", new_categorization_path(current_user.id, :category_id

我有一个rails 3应用程序,它有相当多的ajax功能,非常复杂,除了IE之外,它在每个浏览器中都运行得很好,非常漂亮。虽然我不确定为什么,但我猜它与HTML5有关。以下是为简洁起见编辑的我的部分应用程序

他认为:

<li id="category_<%= category.id %>">
  <%= link_to "#{category.title}", new_categorization_path(current_user.id, :category_id => category.id), :remote => true %>
</li>
除了目前使用IE8的IE之外,这段代码在所有其他浏览器中都能很好地工作,但我相信在所有版本的IE中都是一样的。在IE中,它似乎部分工作,当我点击它时,链接会显示出应有的黄色背景,但它似乎根本没有更新HTML,当我查看源代码时,它似乎保持不变,当我再次点击链接时,什么也没发生。此外,如果我检查数据库,它似乎根本没有创建新的分类

我错过了什么?Mime类型?我应该把代码放在一个单独的js.erb文件中吗

谢谢

你用了两次双引号。尝试使用“ustead”这个选项


我最终在一个单独的UJS文件中完成了所有相关的AJAX,这似乎已经完成了

A la:new.js.erb

  def new
    @category = Category.find(params[:category_id])
    @categorization = Categorization.create(:user_id => current_user.id, :category_id => params[:category_id])
    render :update do |page|
      page.replace_html "category_#{params[:category_id]}", "#{link_to "#{@category.title}", categorization_path(current_user.id, :category_id => @category.id), :method => :delete, :remote => true, :style => "background-color:yellow;"}"
    end
  end
  def new
    @category = Category.find(params[:category_id])
    @categorization = Categorization.create(:user_id => current_user.id, :category_id => params[:category_id])
    render :update do |page|
      page.replace_html "category_#{params[:category_id]}", "#{link_to '#{@category.title}', categorization_path(current_user.id, :category_id => @category.id), :method => :delete, :remote => true, :style => "background-color:yellow;"}"
    end
  end