app/controllers/rocks_controller.rb
#Find rock and on to rocks/show view. Also,
#access all the comment user_ids, put them in a hash, and send them in via @commnet_user.
Find rock and on to rocks/show view. Also,
access all the comment user_ids, put them in a hash, and send them in via @commnet_user.
Find rock and on to rocks / show view . Also access all the comment user_ids put them in a hash and send them in via @commnet_user .
def show
        @rock = Rock.find(params[:id])
        @comment_user = {}
        @rock.comments.each do |comment|
            if @comment_user[comment.user_id] == nil
               user = User.find_by_id(comment.user_id)
               @comment_user[user.id] = user.name
            end
        end
    end
def show @rock = Rock . find ( params [ :id ] ) @comment_user = { } @rock . comments . each do | comment | if @comment_user [ comment . user_id ] == nil user = User . find_by_id ( comment . user_id ) @comment_user [ user . id ] = user . name end end end
Find rock and on to rocks/show view.
Find rock and on to rocks / show view .