app/controllers/posts_controller.rb
#this index method works for all posts or all posts for a specific artist

this index method works for all posts or all posts for a specific artist
this index method works for all posts or all posts for a specific artist
def index
        if params[:artist_id]
            @posts = Post.where(artist: params[:artist_id])
        elsif 
            @posts = Post.all
        end 
    end
def index if params [ :artist_id ] @posts = Post . where ( artist : params [ :artist_id ] ) elsif @posts = Post . all end end
this index method works for all posts or all posts for a specific artist
this index method works for all posts or all posts for a specific artist