title: How can I get post to be created on rails after setting up users with devise gem?
body: <p>I am trying to build a basic User/Post app on Ruby on Rails and everything was working smoothly, but then I added the devise gem to create the login/sign up for me and now I am not able to create a post. Once the user signs in they are redirected to http://localhost:3000/posts. There they can click &quot;add new plant&quot; (its posts about plants) and it takes them to the http://localhost:3000/posts/new page. Here the form is up and running, the user can fill in the title and description and hit the create post button, but then it just stays on this page and nothing happens. The post doesnt even get saved. If anyone could please give me some insight on how I can attempt to fix this, I would really appreciate it! The posts were being created normally before I added the users table with devise.</p>
  <pre><code>Started POST &quot;/posts&quot; for ::1 at 2020-07-26 12:24:01 -0400
  Processing by PostsController#create as HTML
    Parameters: {&quot;authenticity_token&quot;=&gt;&quot;Fm7HPgNsIJkKYzgOm/ApVCZfZJJuVQOLMP7eZvz1zFLok1QZdPxGC3f0p1Z1sRdUofCMlL5RU8wXwv31FIkj0w==&quot;, &quot;post&quot;=&gt;{&quot;title&quot;=&gt;&quot;Lavender &quot;, &quot;description&quot;=&gt;&quot;testing hello &quot;}, &quot;commit&quot;=&gt;&quot;Create Post&quot;}
    User Load (0.2ms)  SELECT &quot;users&quot;.* FROM &quot;users&quot; WHERE &quot;users&quot;.&quot;id&quot; = ? ORDER BY &quot;users&quot;.&quot;id&quot; ASC LIMIT ?  [[&quot;id&quot;, 1], [&quot;LIMIT&quot;, 1]]
    Rendering posts/new.html.erb within layouts/application
    Rendered posts/_form.html.erb (Duration: 13.2ms | Allocations: 5423)
    Rendered posts/new.html.erb within layouts/application (Duration: 13.6ms | Allocations: 5487)
  [Webpacker] Everything's up-to-date. Nothing to do
  Completed 200 OK in 37ms (Views: 29.1ms | ActiveRecord: 0.2ms | Allocations: 11827)
  </code></pre>
  <p>that is the what shows up when I hit the create post button. Here is my schema:</p>
  <pre><code>ActiveRecord::Schema.define(version: 2020_07_26_023022) do
  
    create_table &quot;posts&quot;, force: :cascade do |t|
      t.string &quot;title&quot;
      t.text &quot;description&quot;
      t.datetime &quot;created_at&quot;, precision: 6, null: false
      t.datetime &quot;updated_at&quot;, precision: 6, null: false
      t.integer &quot;user_id&quot;
    end
  
    create_table &quot;users&quot;, force: :cascade do |t|
      t.string &quot;email&quot;, default: &quot;&quot;, null: false
      t.string &quot;encrypted_password&quot;, default: &quot;&quot;, null: false
      t.string &quot;reset_password_token&quot;
      t.datetime &quot;reset_password_sent_at&quot;
      t.datetime &quot;remember_created_at&quot;
      t.datetime &quot;created_at&quot;, precision: 6, null: false
      t.datetime &quot;updated_at&quot;, precision: 6, null: false
      t.index [&quot;email&quot;], name: &quot;index_users_on_email&quot;, unique: true
      t.index [&quot;reset_password_token&quot;], name: &quot;index_users_on_reset_password_token&quot;, unique: true
    end
  
  end
  </code></pre>
  <p>Here is my posts controller:</p>
  <pre><code>class PostsController &lt; ApplicationController
      before_action :find_post, only: [:show, :edit, :update, :destroy]
  
      def index
          @posts = Post.all.order(&quot;created_at DESC&quot;)
      end
  
      def show
      end
  
      def new 
          @post = Post.new
      end
  
      def create 
          @post = Post.new(post_params)
          if @post.save
              redirect_to @post 
          else
              render 'new'
          end
      end
  
      def edit 
      end
  
      def update 
          if @post.update(post_params)
              redirect_to @post
          else 
              rend 'new'
          end
  
      end
  
      def destroy 
          @post.destroy
          redirect_to posts_path
      end
  
      private 
          def find_post
              @post = Post.find(params[:id])
          end
  
          def post_params
              params.require(:post).permit(:title, :description, :user_id)
          end
  end 
  </code></pre>