I'm following Michael Hartl's tutorial but I'm getting this error when I run the bundle exec rake test:
1) Error:
UsersControllerTest#test_should_get_new:
ActionView::Template::Error: undefined method `remember_me' for #<User:0x000000058544b8>
app/views/users/new.html.erb:25:in `block (2 levels) in _app_views_users_new_html_erb__1810619291483938060_46219160'
app/views/users/new.html.erb:24:in `block in _app_views_users_new_html_erb__1810619291483938060_46219160'
app/views/users/new.html.erb:6:in `_app_views_users_new_html_erb__1810619291483938060_46219160'
test/controllers/users_controller_test.rb:6:in `block in <class:UsersControllerTest>'
2) Error:
UsersSignupTest#test_invalid_signup_information:
ActionView::Template::Error: undefined method `remember_me' for #<User:0x00000006acef08>
app/views/users/new.html.erb:25:in `block (2 levels) in _app_views_users_new_html_erb__1810619291483938060_46219160'
app/views/users/new.html.erb:24:in `block in _app_views_users_new_html_erb__1810619291483938060_46219160'
app/views/users/new.html.erb:6:in `_app_views_users_new_html_erb__1810619291483938060_46219160'
test/integration/users_signup_test.rb:6:in `block in <class:UsersSignupTest>'
3) Error:
UsersSignupTest#test_valid_signup_information:
ActionView::Template::Error: undefined method `remember_me' for #<User:0x000000074f6ff8>
app/views/users/new.html.erb:25:in `block (2 levels) in _app_views_users_new_html_erb__1810619291483938060_46219160'
app/views/users/new.html.erb:24:in `block in _app_views_users_new_html_erb__1810619291483938060_46219160'
app/views/users/new.html.erb:6:in `_app_views_users_new_html_erb__1810619291483938060_46219160'
test/integration/users_signup_test.rb:17:in `block in <class:UsersSignupTest>'
This is the new.html.erb file:
<% provide(:title, 'Sign up') %>
<h1>Sign up</h1>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<%= form_for(@user) do |f| %>
<%= render 'shared/error_messages' %>
<%= f.label :name %>
<%= f.text_field :name, class: 'form-control' %>
<%= f.label :email %>
<%= f.email_field :email, class: 'form-control' %>
<%= f.label :password %>
<%= f.password_field :password, class: 'form-control' %>
<%= f.label :password_confirmation, "Confirmation" %>
<%= f.password_field :password_confirmation, class: 'form-control' %>
<%= f.label :remember_me, class: "checkbox inline" do %>
<%= f.check_box :remember_me %>
<span>Remember me on this computer</span>
<% end %>
<%= f.submit "Create my account", class: "btn btn-primary" %>
<% end %>
</div>
</div>
^Just like listing 8.47 in the rails tutorial http://ift.tt/1x2gdUr
It seems rails thinks :remember_me is a method, but why??? Why is :remember_me thought to be a method when all the other labels aren't??? I don't fkcing get it.
Background: I've went through half a ruby tutorial and entered this rails tutorial. i have very basic html and css abilities. Never touched ruby before. And I don't really understand half of the concepts in this chapter. I mostly just followed the instructions. So please, explain in noob terms :)
Aucun commentaire:
Enregistrer un commentaire