我使用的Ruby on由邁克爾·哈特爾Rails的教程 - 第8章 - Rails的3 我用導軌3.1 在文件new.html.erb我:缺少部分紅寶石第8章教程
<h1>Sign up</h1>
<%= form_for(@user) do |f| %>
<%= render 'shared/error_messages' %>
嘗試參觀http://localhost:3000/signup,它給了我下面的消息:
ActionView::MissingTemplate in Users#new
Missing partial /shared/error_messages with {:handlers=>[:erb, :builder, :coffee],
:formats=>[:html], :locale=>[:en, :en]}. Searched in:
* "/Users/macbook/rails_projects/sample_app/app/views"
我用Google搜索周圍也沒有找到這個答案。同樣的問題被張貼在不久前於: Ruby Chapter 8 tutorial partial file not found
我試了一下: -putting一/中的共享 前 - 把:部分=>渲染後 -putting:目標=> @user
如果我不把它放到共享文件夾中,它可以工作。在rails 3.1.3中有沒有不同的方法來做到這一點?請讓我知道,因爲我花了很多時間試圖找出答案。
你真是個好人!非常感謝!我希望其他人也能看到這個答案,因爲我一直在尋找,找不到它。對於任何人來說,我只是將上面的部分改爲 <%= render「users/shared/error_messages」%> – user1162885