Stuck again. It says there"Then in the Tags controller, add the show action:" …And I did exactly what was asked, pasted the code into the tags controller file. But no matter where I try to fill in the method ‘destinations’ it keeps saying that its undefined. Here’s the code:
class TagsController < ApplicationController
def index
@tags = Tag.all
end
def show
@tag = Tag.find(params[:id])
@destinations = @tag.destinations
end
end
<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="tag">
<div class="container">
<h2 class="tag-title"> </h2>
<div class="cards row">
<!--
To do: Loop through destinations and display each one with this HTML
<div class="card col-xs-4">
destination's image goes here
<h2> destination's name goes here </h2>
<p> destination's description goes here </p>
</div>
-->
</div>
</div>
</div>
@kosmotakis Well, your index and show code isn’t complete, but I don’t think that’s really your problem.
Could you post the code in config/routes.rb please? (almost definitely the last file I’ll need )
Hey man. Want to know what the problem was? Like many times it was a missing space:smile:. this is the code that worked `class TagsController < ApplicationController
def index @tags = Tag.all
end
def show
@tag = Tag.find(params[:id])
@destinations = @tag.destinations
end