Stuck on "Show a Tag" 5/9


#1

I'm having the same issue but am unable to move forward. Here is my code.

class TagsController < ApplicationController
  def index
		@tags = Tag.all
	end
  def show 
		@tag = Tag.find(params[:id]) 
		@destinations = @tag.destinations 
	end
end

Show a tag 5/9
#2

@shiggensdev Could you please post a link to the exercise you're on and the code you have for show.html.erb?


#4

Here is the link.

https://www.codecademy.com/en/courses/learn-rails/lessons/one-many/exercises/one-many-show-tag?action=resume

and my code...

<div class="header">
  <div class="container">
    <img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1tm.svg" width="80">
    <h1>BokenjiKan</h1>
  </div>
</div>

<div class="tags">
  <div class="container">
    <div class="cards row">
    

    </div>
  </div>
</div>

#5

@shigginsdev I don't see any problems in your code. Which step in that exercise are you on?


#6

I'm on step three. If I comment out this line:

the error message goes away but then I obviously can't complete the rest of the steps.


#7

@shigginsdev No, you should leave that line alone, uncommented. Since you're on step three, you need to be working in app/views/tags/show.html.erb. The instructions say:

In app/views/tags/show.html.erb inside the <h2> element, display a tag's title.

Then in <div class="cards">...</div>, iterate through each destination in the @destinations array and display its image, name, and description.

Step one should be pretty easy, put <%= @tag.title %> inside an <h2>. Then, for step two, you'll use a @destinations.each do |destination| loop. Do you remember how to do that?


#8

Sorry, it's step 2 where I get the error. Here is my code.

class TagsController < ApplicationController
  def index
		@tags = Tag.all
	end
  def show 
		@tag = Tag.find(params[:id]) 
		@destinations = @tag.destinations 
	end
end

#9

@shigginsdev Aside from an extra blank line in mine (which doesn't affect anything), your code is identical to mine, so I'm not sure why it's not working for you :confused:
You are adding that code in app/controllers/tags_controller.rb, right?


#10

Correct. I've tried this several times on several different days. Always the same error.


#11

@shigginsdev I'm really sorry, but I don't know what's wrong :frowning:
Please let me know if you figure it out!


#12

Do you know how to contact Codecadmy support directly? I've filled out the "Report a Bug" form twice with no response. I was considering upgrading to a Premium account but now...


#13

@shigginsdev Codecademy sees their email & messages, but they're not very good at responding to them, just because they get so many.
I would file this as a bug directly into our bug tracker, but I haven't seen anyone else with the same problem, which makes me feel that there's got to be a problem somewhere else in your code, I just don't know where :confused:

If you create a Pro account, it's super easy to cancel in the first two weeks (Settings → Cancel Pro), and you could share your code with me easily by clicking the triangle-ish shaped button by the “Run” button and sharing the URL with me.
(I don't mean to sound like I'm trying to make a sale, but I do think if you could share your entire code with me it'd be great)


#17

This topic is inactive.