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: <h1>Add new book</h1>
2: <%= form_tag :action => 'create' %>
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>:
here is the new.rhtml file:
<h1>Add new book</h1>
<%= form_tag :action => 'create' %>
<p><label for="book_title">Title</label>:
<%= text_field 'book', 'title' %></p>
<p><label for="book_price">Price</label>:
<%= text_field 'book', 'price' %></p>
<p><label for="book_subject">Subject</label>:
<%= collection_select(:book,:subject_id,@subjects,:id,:name) %></p>
<p><label for="book_description">Description</label><br/>
<%= text_area 'book', 'description' %></p>
<%= submit_tag "Create" %>
<%= end_form_tag %>
<%= link_to 'Back', {:action => 'list'} %>
thanx indeed for your help!
Tantor
Frederick Cheung wrote:
> start_form_tag has been deprecated and subsequently removed. use
> form_tag instead:
>
> <% form_tag :action => :foo, ... do %>
> form elements here
> <% end>
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.