Display all tags, step 3

I am doing
def index
@tags = Tag.all
end
but it didn’t work
can anybody tell me what is the problem
thanks

1 Like

Hi @frentea,

Please post your full code, a link to the exercise you’re on, and the error message you’re getting so we can help you.

Thanks for help!
Now I am posting some pictures of my problem.



@frentea Your code in tags_controller.rb looks fine to me - what if you put a space on either side of the equal sign (=), like this:

@tags = Tag.all

?

I tried this, didn’t work either.
I also tried:
@tags = Tags.all
@tags = tags.all
@tags = tag.all
all failed.
I think maybe something in front steps was wrong, but codecademy passed me here to this step, which seems I got all right answers before. Therefore I really don’t know where I am missing or wrong.

@frentea The code I posted is correct, so probably something did go wrong earlier. Could I see your code in config/routes.rb?

Also, what does it say in the error message you get?

the code is like this in routes.rb:


and there is no message getting when this error occurs, just like the 3rd picture I send you in the last reply.

plus, I tried: get ‘tags’ => ‘Tags#index’
also failed.

@frentea Try lowercasing Tags#index

failed again…I’ve reported a bug.

Got the same problem. Have reported a bug as well!

Yeah, maybe it’s a systematic problem. I reported a bug, you can do that too.

@frentea So get tags => 'tags#index' (that exact code) didn’t work?

Yep…

I reported bug for two times, but nothing happened.

Is there any other problem you think might be possible?

Just restart the exercise. I had the same problem, when i restarted it had solved.

Same issue. Also reported a bug. Let’s hope they fix it soon. Restarting didn’t help for me, sadly.

I tried “I want to restart this exercise” and it worked for me.

Can any one help me solving this error message.
def index
@tags = tag.all
end

@frentea My bad, I meant get 'tags' => 'tags#index' (with quotes around tags). But due to the number of other people saying this exercise is bugged, I’m guessing it probably is, and that this isn’t a problem with your code :confused:

I tried “I want to restart this exercise” in “get help” and it worked. So people have similar problem could try this. Thank you very much for help! @zystvan

1 Like