title: Rails 4 : Current user can only edit their post
body: <p>User is only able to edit when they are logged in but the problem is any user logged in can edit other users content. How to make user specific edit, only the current user can only edit their content?</p>
  
  <pre><code>class JobsController &lt; ApplicationController
      before_action :find_job, only: [:show, :edit, :update, :destroy]
      before_action :authenticate_user!,except:[:index]
  
      def show
      end
  
      def update
          if @job.update(jobs_params)
              redirect_to @job
          else
              render "Edit"
          end
      end 
  
      private
  
      def jobs_params
          params.require(:job).permit(:title, :description, :company, :url, :jobcategory_id)
      end
  
      def find_job
          @job = Job.find(params[:id])
      end
  end
  
  
  show.html.haml                                            
  - if user_signed_in?
      = link_to "Back", root_path, class: "btn btn-sm btn-default"
      = link_to "Edit", edit_job_path(@job), class: "btn btn-sm btn-default"
  </code></pre>