Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.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 当文件存在于Rails 4.2中时,ajax调用中的render:file中缺少模板_Ruby On Rails_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails 当文件存在于Rails 4.2中时,ajax调用中的render:file中缺少模板

Ruby on rails 当文件存在于Rails 4.2中时,ajax调用中的render:file中缺少模板,ruby-on-rails,ruby-on-rails-4,Ruby On Rails,Ruby On Rails 4,Ajax用于引导模式调用。成功调用js.erb文件,然后该js.erb文件应加载html.erb,该文件位于js.erb下的biz_workflowz/app/views/application/下的同一个子目录下。以下是js.erb文件: $("#newworkflow .modal-content").html('<%= j render(:file => "/biz_workflowx/application/event_action.html.erb") %>'); $

Ajax用于引导模式调用。成功调用
js.erb
文件,然后该
js.erb
文件应加载
html.erb
,该文件位于
js.erb
下的
biz_workflowz/app/views/application/
下的同一个子目录下。以下是
js.erb
文件:

$("#newworkflow .modal-content").html('<%= j render(:file => "/biz_workflowx/application/event_action.html.erb") %>');
$("#newworkflow").modal();
错误是:

    ActionView::Template::Error (Missing template c:/d/code/rails_proj/engines/biz_workflowx/app/views/application/event_action.html.erb with {:locale=>[:en], :formats=>[:js, :html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee]}. Searched in:
   .......
      * "C:/D/code/rails_proj/engines/biz_workflowx/app/views" #<<== did search the subdir but did not find anything
      * "C:/D/code/rails_proj/engines/searchx/app/views"
      * "C:/D/code/rails_proj/engines/commonx/app/views"
      * "C:/D/code/rails_proj/engines/authentify/app/views"
      * "C:/D/code/rails_proj/webportal"
      * "C:/"
    ):
        1: $("#newworkflow .modal-content").html('<%= j render(:file => "biz_workflowx/application/event_action.html.erb") %>');
        2: $("#newworkflow").modal();
      actionview (4.2.0) lib/action_view/path_set.rb:46:in `find'
ActionView::Template::Error(缺少模板c:/d/code/rails_proj/engines/biz_workflowx/app/views/application/event_action.html.erb和{:locale=>[:en],:formats=>[:js,:html],:variants=>[],:handlers=>[:erb,:builder,:raw,:ruby,:coffee]}。在以下位置搜索:
.......

*“C:/D/code/rails_proj/engines/biz_workflowx/app/views”#在
C:/D/code/rails_proj/engines/biz_workflowx/app/views/application下添加
event_action.html.erb
文件

    ActionView::Template::Error (Missing template c:/d/code/rails_proj/engines/biz_workflowx/app/views/application/event_action.html.erb with {:locale=>[:en], :formats=>[:js, :html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee]}. Searched in:
   .......
      * "C:/D/code/rails_proj/engines/biz_workflowx/app/views" #<<== did search the subdir but did not find anything
      * "C:/D/code/rails_proj/engines/searchx/app/views"
      * "C:/D/code/rails_proj/engines/commonx/app/views"
      * "C:/D/code/rails_proj/engines/authentify/app/views"
      * "C:/D/code/rails_proj/webportal"
      * "C:/"
    ):
        1: $("#newworkflow .modal-content").html('<%= j render(:file => "biz_workflowx/application/event_action.html.erb") %>');
        2: $("#newworkflow").modal();
      actionview (4.2.0) lib/action_view/path_set.rb:46:in `find'