Rails message: ActionView::MissingTemplate

前端 未结 2 1707
再見小時候
再見小時候 2021-02-18 23:19

I am getting an error that I cannot figure out:

ActionView::MissingTemplate (Missing template cluster/delete_stuff.erb in view path app/views)
<...snip trace.         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-19 00:13

    ActionView will look for templates/partials in the current controllers view folder, unless its view path has been changed in the controller—you can prepend and append different view paths for it to try and match first. Since you mention partials specifically, have a look at the documentation on partials.

    Do you have a _delete_stuff.html.erb file in your views/cluster directory? If not, where is the _delete_stuff.html.erb partial? If it's not in the same directory, you will have to call render :partial => 'other_directory/delete_stuff' for your partial to appear.

提交回复
热议问题