While doing a tutorial on tutorialpoint, I had the same problem! I made
the change, but I get another error :
NoMethodError in Book#new
Showing app/views/book/new.rhtml where line #4 raised:
undefined method `title’ for #<Book id: nil, created_at: nil,
updated_at: nil>
Extracted source (around line #4):
1:
Add new book
2: <%= form_tag :action => ‘create’ %>
3:
Title:
4: <%= text_field ‘book’, ‘title’ %>
5:
Price:
6: <%= text_field ‘book’, ‘price’ %>
7:
Subject:
here is the new.rhtml file:
Add new book
<%= form_tag :action => 'create' %>
Title:
<%= text_field 'book', 'title' %>
Price:
<%= text_field 'book', 'price' %>
Subject:
<%= collection_select(:book,:subject_id,@subjects,:id,:name) %>
Description
<%= text_area 'book', 'description' %>
<%= submit_tag "Create" %>
<%= end_form_tag %>
<%= link_to 'Back', {:action => 'list'} %>
thanx indeed for your help!
Tantor
Frederick C. wrote:
start_form_tag has been deprecated and subsequently removed. use
form_tag instead:
<% form_tag :action => :foo, … do %>
form elements here
<% end>