Undefined method `start_form_tag' for #<ActionView::Base:0x3

I have crated controller classified
class ClassifiedController < ApplicationController
def list
@classifieds = Classified.find(:all)
end
def show
@classified = Classified.find(params[:id])
end
def new
@classified=Classified.new
end
def create
end
def edit
end
def update
end
def delete
end

end
and created classified/new.rhtml

start_form_tag has been deprecated and subsequently removed. use
form_tag instead:

<% form_tag :action => :foo, … do %>
form elements here
<% end>

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>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs