Hello,
I have been following this tutorial, but ran into a problem. In:
http://www.tutorialspoint.com/ruby-on-rails/rails-views.htm
I get to the point where I created the
new method, but once I navigate to
http://localhost:3000/book/new, I end up with this error:
NoMethodError in Book#new
Showing app/views/book/new.html.erb where line #4 raised:
undefined method `title' for #<Book id: nil, created_at: nil, updated_at: nil>
Extracted source (around line #4):
1: <h1>Add new book</h1>
2: <% form_tag :action => 'create' do %>
3: <p><label for="book_title">Title</label>:
4: <%= text_field 'book', 'title' %></p>
5: <p><label for="book_price">Price</label>:
6: <%= text_field 'book', 'price' %></p>
7: <p><label for="book_subject">Subject</label>:
Can someone help me out. This is my first RoR tutorial and I'm already stuck
Thanks!