Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.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
Ruby on rails CoffeeScript函数似乎没有出现_Ruby On Rails_Coffeescript - Fatal编程技术网

Ruby on rails CoffeeScript函数似乎没有出现

Ruby on rails CoffeeScript函数似乎没有出现,ruby-on-rails,coffeescript,Ruby On Rails,Coffeescript,在我的CoffeeScript模块中,我有以下功能: Ruby 2.1.5 Rails 3.2.18 我添加了以下功能: disableSelectedOptionsFor = (item)-> $fields = $(".inventory-table-group:visible") $(".#{item} select>option").each (i, el)-> if el.value != "" && $fields.find("[i

在我的CoffeeScript模块中,我有以下功能:

Ruby 2.1.5
Rails 3.2.18
我添加了以下功能:

disableSelectedOptionsFor = (item)->
  $fields = $(".inventory-table-group:visible")
  $(".#{item} select>option").each (i, el)->
    if el.value != "" && $fields.find("[id$=\"#{el.value}_#{item}_id\"]").length > 0
      $(el).attr('disabled','disabled')
    else
      $(el).removeAttr('disabled')
我删除了/tmp文件夹。我删除了/public/assets文件夹

然后我做了:

enableAllSelectedOptionsFor = (item)->
  $fields = $(".inventory-table-group:visible")
  $(".#{item} select>option").each (i, el)->
    $(el).removeAttr('disabled')
我在Firefox浏览器中启动了Rails应用程序。我安装了firebug

当我查找
disableselectedoptions for
函数时,它就在那里,但我找不到
enableallselectedoptions for

有什么想法吗?咖啡脚本不是我的强项

以下是Firebug中DisableSelectedOptions for函数的显示方式:

RAILS_ENV=test RAILS_GROUPS=assets bundle exec rake assets:precompile
sudo service apache2 restart

这两个函数在同一个文件中?它们的缩进是一样的吗?意思是一个不在另一个里面?它们缩进相同,就像一个不在另一个里面一样。在源代码中,它们看起来就像我在问题中看到的一样。请查看对我的问题的编辑
disableSelectedOptionsFor = function(item) {
  var $fields;
  $fields = $(".inventory-table-group:visible");
  return $("." + item + " select>option").each(function(i, el) {
    if (el.value !== "" && $fields.find("[id$=\"" + el.value + "_" + item + "_id\"]").length > 0) {
      return $(el).attr('disabled', 'disabled');
    } else {
      return $(el).removeAttr('disabled');
    }
  });
};