Trying to follow a book but my form isn’t being generated, why is this?
Here is my new.html.erb
<h1>New ad</h1>
<% form_for :ad,:url=>{:action=>'create'} do |f| %>
<p><b>Name</b><br /><%= f.text_field :name %></p>
<p><b>Description</b><br /><%= f.text_area :description %></p>
<p><b>Price</b><br /><%= f.text_field :price %></p>
<p><b>Seller</b><br /><%= f.text_field :seller_id %></p>
<p><b>Email</b><br /><%= f.text_field :email %></p>
<p><b>Img url</b><br /><%= f.text_field :img_url %></p>
<p><%= f.submit "Create" %></p>
<% end %>
This is my ads_controller
class AdsController < ApplicationController
def show
@ad = Ad.find(params[:id])
end
def stats
@seller = Seller.find(params[:id])
end
def index
@ads = Ad.find(:all)
end
def new
@ad = Ad.new
end
end
and my routes is
resources :ads
This is all that I get
<% form_forshould be<%= form_foror the form template will not be rendered.