title: No confirmation messages after submit
body: <p>I'm working in a <code>Rails 4.1.0</code> application in <code>cloud9 IDE</code>. I enter test info in the <code>fields: Name, Email, Comments</code> in the Contact Us form page, clicked submit and the following info displays in the address bar with no 'Message sent' confirmation: </p>
  
  <p><a href="https://manual-coder-rails/contacts?utf8=%E2%9C%93&amp;contact%5Bname%5D=Nick&amp;contact%5Bemail%5D=victorysupplys%40gmail.com&amp;contact%5Bcomments%5D=Nice+web&amp;commit=Submit" rel="nofollow">https://manual-coder-rails/contacts?utf8=%E2%9C%93&amp;contact%5Bname%5D=Nick&amp;contact%5Bemail%5D=victorysupplys%40gmail.com&amp;contact%5Bcomments%5D=Nice+web&amp;commit=Submit</a></p>
  
  <p>I entered no info in the fields (blank), clicked submit, the blank info is displayed in the address bar, again no 'Error' confirmation message: </p>
  
  <p><a href="https://manual-coder-rails/contacts?utf8=%E2%9C%93&amp;contact%5Bname%5D=&amp;contact%5Bemail%5D=&amp;contact%5Bcomments%5D=&amp;commit=Submit" rel="nofollow">https://manual-coder-rails/contacts?utf8=%E2%9C%93&amp;contact%5Bname%5D=&amp;contact%5Bemail%5D=&amp;contact%5Bcomments%5D=&amp;commit=Submit</a> </p>
  
  <p>I enter <code>bundle exec rails c</code> and <code>Contact.all</code> in the console, no entries are listed here and no entries are saved to the database:   </p>
  
  <blockquote>
    <p>2.3.0 :001 > Contact.all<br>
    Contact Load (2.9ms)  SELECT "contacts".* FROM "contacts"</p>
  </blockquote>
  
  <pre><code>&gt; =&gt; #&lt;ActiveRecord::Relation []&gt;
  </code></pre>
  
  <p>I tried to figure out what the problem is in my code, having made several changes, but to no avail. Someone might notice something I do not. Here is my code for perusal and advice:</p>
  
  <p>Contacts_controller.rb</p>
  
  <pre><code>class ContactsController &lt; ApplicationController
    def new
      @contact = Contact.new
    end              
  
    def index
    end  
  
    def create
      @contact = Contact.new(contact_params)
      if @contact.save
        name = params[:contact][:name]
        email = params[:contact][:email]
        body = params[:contact][:comments]
        ContactMailer.contact_email(name, email, body).deliver
        flash[:success] = "Message sent."
        redirect_to new_contact_path
      else
        flash[:danger] = "Error occured, message has not been sent."
        redirect_to new_contact_path
      end
    end
  
    private
    def contact_params
     params.require(:contact).permit(:name, :email, :comments)
    end
  end
  </code></pre>
  
  <p>routes.rb</p>
  
  <pre><code>Rails.application.routes.draw do
    resources :contacts, only:[:new, :create], path_names: { new: ""}
    get '/about' =&gt; 'pages#about'
    root 'pages#home'
  </code></pre>
  
  <p>application.html.erb</p>
  
  <pre><code>&lt;div class="container"&gt;
     &lt;% flash.each do |key, value| %&gt;
       &lt;div class="alert alert-success", role="alert"&lt;% key %&gt;"Message sent!"&gt;   
         &lt;% value %&gt;
       &lt;/div&gt;
       &lt;div class="alert alert-danger", role="alert"&lt;% key %&gt;"Error occured, message not sent!"&gt;&lt;% value %&gt;
       &lt;/div&gt;
       &lt;button type="button", class="close", data-dismiss="alert", aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&lt;/span&gt;&amp;times;&gt;&lt;/span&gt;&lt;/button&gt;
       &lt;%= value %&gt;
     &lt;% end %&gt;
   &lt;/div&gt;
   &lt;%= yield %&gt;
  </code></pre>
  
  <p></p>