title: Routing Error No route matches [POST] "/book/create"
body: <p>Iam trying to insert some data in to database.but showing following error</p>
  
  <pre><code>Routing Error
  
  No route matches [POST] "/book/create"
  </code></pre>
  
  <p>code for form submittion is new.html.erb</p>
  
  <pre><code>&lt;h1&gt;Add new book&lt;/h1&gt;
  &lt;%= form_tag :action =&gt; 'create' %&gt;
  &lt;p&gt;&lt;label for="book_title"&gt;Title&lt;/label&gt;:
  &lt;%= text_field 'book','title' %&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="book_price"&gt;Price&lt;/label&gt;:
  &lt;%= text_field 'book','price'%&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="book_subject"&gt;Subject&lt;/label&gt;:
  &lt;%= text_field 'subject','subject'%&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="book_description"&gt;Description&lt;/label&gt;&lt;br/&gt;
  &lt;%= text_area 'book','description'%&gt;&lt;/p&gt;
  &lt;%= submit_tag "Create"%&gt;
  &lt;%= link_to 'Back',{:action=&gt;'list'}%&gt;
  </code></pre>
  
  <p>routers.rb is</p>
  
  <pre><code>Library::Application.routes.draw do
    get "book/list"
  
    get "book/show"
  
    get "book/new"
  
    get "book/create"
  
    get "book/edit"
  
    get "book/update"
  
    get "book/delete"
  
      resources :books, :only =&gt; [:new, :create]
      match '/books' =&gt; 'books#create', :via =&gt; :post
  </code></pre>
  
  <p>Here is the html code for new.html.erb</p>
  
  <pre><code>&lt;h1&gt;Add new book&lt;/h1&gt;
  &lt;form accept-charset="UTF-8" action="/book/create" method="post"&gt;
  &lt;p&gt;&lt;label for="book_title"&gt;Title&lt;/label&gt;:
  &lt;input id="book_title" name="book[title]" size="30" type="text" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="book_price"&gt;Price&lt;/label&gt;:
  &lt;input id="book_price" name="book[price]" size="30" type="text" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="book_subject"&gt;Subject&lt;/label&gt;:
  &lt;input id="subject_subject" name="subject[subject]" size="30" type="text" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label for="book_description"&gt;Description&lt;/label&gt;&lt;br/&gt;
  &lt;textarea cols="40" id="book_description" name="book[description]" rows="20"&gt;
  &lt;/textarea&gt;&lt;/p&gt;
  &lt;input name="commit" type="submit" value="Create" /&gt;
  &lt;a href="/book/list"&gt;Back&lt;/a&gt;
  </code></pre>
  
  <p>Here is the bookcontoller.rb</p>
  
  <pre><code>class BookController &lt; ApplicationController
     def list
        @books = Book.find(:all)
     end
     def show
        @book = Book.find(params[:id])
     end
     def new
        @book = Book.new
        @subjects = Subject.find(:all)
     end
     def create
        @book = Book.new(params[:book])
        if @book.save
              redirect_to :action =&gt; 'list'
        else
              @subjects = Subject.find(:all)
              render :action =&gt; 'new'
        end
     end
     def edit
        @book = Book.find(params[:id])
        @subjects = Subject.find(:all)
     end
     def update
        @book = Book.find(params[:id])
        if @book.update_attributes(params[:book])
           redirect_to :action =&gt; 'show', :id =&gt; @book
        else
           @subjects = Subject.find(:all)
           render :action =&gt; 'edit'
        end
     end
     def delete
        Book.find(params[:id]).destroy
        redirect_to :action =&gt; 'list'
     end
     def show_subjects
        @subject = Subject.find(params[:id])
     end
  end
  </code></pre>