I am trying to create a simple form in Rails 3. But facing this issue:
Showing /home/praveen/rails_projects/mebay/app/views/ads/new.html.erb where line #2 raised:
No route matches {:action=>"create", :new=>"new", :controller=>"ads"}
<h1> New Ad</h1>
<% form_for @ad, url:{action: "create"} do |f| %>
<p>
<b>Name</b>
<%= f.text_field :name %>
I am a beginner in Rails but as per my understanding , there is some problems in the config/route.rb ..
I have declared following routes in this file...
get 'ads/:new'=>'ads#new'
get 'ads/:create'=>'ads#create'
get 'ads/'=>'ads#index'
get 'ads/:id'=>'ads#show'
Last is the controller file where i have declared my functions:
class AdsController < ApplicationController
def new
@ad=Ad.new
end
Let me know if some more information is required.