```ruby
class PostsController < ApplicationController
  def index
  end

  def show
  end

  def new
  	redirect_to root_url if !logged_in?
  	@post = Post.new
  end

  def create
  	@post = Post.new(post_params)
  end

  def edit
  end

  def delete
  end

  private
  def post_params
    params.require(:post).permit(:title, :body)
  end
end
```

Work on Posts controller--protections and new posts
user
```ruby
class PostsController < ApplicationController
  before_action :redirect, only: [:edit, :destroy]
  def index
  end

  def show
  end

  def new
  	redirect_to root_url if !logged_in?
  	@post = Post.new
  end

  def create
  	@post = Post.new(post_params)


  end

  def edit
  end

  def delete
  end

  private
  def post_params
    params.require(:post).permit(:title, :body)
  end

  def redirect
  end
end
```
assistant