I have a problem with my Rails blogging engine. Overall, the registration and creation of posts works (they form in the SQLite database), however when I attempt to list all the posts a user created, it throws a NoMethodError in User's show.html.erb view: undefined method 'title'.

**PostsController.rb**

```
class PostsController < ApplicationController
  before_action :user_is_required, only: [:create, :destroy]

  def index
    @posts = Post.all
  end

  def new
   @post = Post.new
  end

  def create
    @post = user_logged_in.posts.create(post_params)
    if @post.save
    flash[:success] = "Your post has been successfully saved."
      redirect_to root_path
    else
      flash[:danger] = "Oops! Something went wrong. Try again."
      redirect_to new_post_path
    end
  end

  def edit
  end

  def update
    if @post.update_attributes(post_params)
      flash[:success] = "Your post has been successfully updated."
      redirect_to post_path(@posts)
    else
      flash[:danger] = "Oops! Something went wrong. Try again."
      render 'post'
    end
  end

  def show
    @post = Post.find(params[:id])
  end

  def destroy
    if @post.destroy
      flash[:success] = "Your post has been successfully deleted."
      redirect_to posts_path
    else
      flash[:danger] = "Oops! Something went wrong. Try again."
    end
  end

  private

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

end

```

**show.html.erb** (User's view)

```
<div class="posts">
  <div class="container marketing">
    <div class="col-lg-4 col-md-4 col-xs-12 col-sm-12">
        <section id="info">
            <%= image_tag("#", :class => "user_avatar") %>
            <h2 class="user_name">
                 <%= user_logged_in.name %>
            </h2>
        </section>
  <% if user_logged_in %>
    <%= link_to "Change avatar", class: "btn btn-primary" %><br>
  <% end %>

  <%= link_to "Follow", class: "btn btn-primary" %>
    </div>
    <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
        <h2>
            <%= user_logged_in.name %> has <%= user_logged_in.posts.count %> posts.
        </h2>
        <% if user_logged_in.posts.any? %>
            <% @posts.each do |post| %>
            <h2 class="title">
                <%= user_logged_in.posts.title %> # The line which raises the error
            </h2>
            <p class="post">
                <%= user_logged_in.posts.content %>
            </p>
            <% end %>
        <% end %>

    </div>
</div>

```

**post.rb**

```
class Post < ActiveRecord::Base
  belongs_to :user
  default_scope -> { order(created_at: :desc) }
  validates :user_id, presence: true
  validates :title, presence: true
  validates :content, presence: true

end

```

I am a newbie in Ruby on Rails and this is my first project. Any and all help will be highly appreciated.

Thanks in advance.