开发者

Ruby Chapter 8 tutorial partial file not found

开发者 https://www.devze.com 2023-03-15 18:02 出处:网络
I am using Ruby on Rails Tutorial by Michael Hartl - Chapter 8 - Rails 3 In the file new.html.erb I have:

I am using Ruby on Rails Tutorial by Michael Hartl - Chapter 8 - Rails 3

In the file new.html.erb I have:

<h1>Sign up</h1>

<%= form_for(@user) do |f| %>
<%= render 'shared/error_messages' %>

I created the file app/views/shared/_error_messages.html.erb

When I run the test: bundle exec rspec spec/requests/users_spec.rb I get the following error messages:

Failures:

  1. Users signup failure should not make a new user

    Failure/Error: visit signup_path
    ActionView::Template::Error:
      Missing partial shared/error_messages with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/username/rails_开发者_StackOverflow中文版projects/my_sample_app/app/views"
    
  2. Users signup success should make a new user

    Failure/Error: visit signup_path
    ActionView::Template::Error:
      Missing partial shared/error_messages with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/username/rails_projects/my_sample_app/app/views"
    


Thanks apneadiving. When I went to the folder app/views/shared and did an ls command it showed the file there. However, when I tried to cat the file it returned file not found. Doing an ls -al showed the file had a @ for extra attributes. I loaded the file in my editor and saved it under another name. Then recreated the original file and removed the old file. Everything worked then.

0

精彩评论

暂无评论...
验证码 换一张
取 消