interview == what is the problem is in this code

 class CommentsController < ApplicationController

  def users_comments

  params[:username] = "talha"

    posts = Post.all

    comments = posts.map(&:comments).flatten

    @user_comments = comments.select do |comment|

      comment.author.username == params[:username]

    end

  end

end

Comments

Popular posts from this blog

Rails 7 Features :: Comparison with Rails 6 and Rails 5