Ruby on rails 当文件存在于Rails 4.2中时,ajax调用中的render:file中缺少模板
Ajax用于引导模式调用。成功调用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") %>'); $
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'