"Show a tag" Not displaying correctly in browser


#1

I've passed all the steps, but when I visit http://localhost:8000/tags I get a jumbled list of words with no pictures, and no "learn more" link


index.html.erb

<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">
      <% @tags.each do |t| %>
      <div class="card col-xs-4">
        <% link_to "Learn more", tag_path(t) %>
        <% image_tag t.image %>
        <h2> <%= t.title %> </h2>
      </div>
      <% end %>

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

show.html.erb

<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"> <%= @tag.title %> </h2>

    <div class="cards row">

            <% @destinations.each do |d| %>
              <div class="card col-xs-4">
        <%= image_tag d.image %>
        <h2> <%= d.name %></h2>
        <p> <%= d.description %> </p>
      </div>
      <% end %>
    </div>

routes.rb

Rails.application.routes.draw do
  
  get '/tags' => 'tags#index'
  get '/tags/:id' => 'tags#show', as: :tag

tags_controller.rb

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

#2

Hi Andrew,

Gem::LoadError: You have already activated rake 10.4.2, but your
Gemfile requires 10.3.2. Prepending `bundle  exec` to your
command may solve this.

Try running bundle exec rake db:seed instead.


#3

That was it, looks good now.

I had a feeling it was a seed problem, just wasn't sure how to fix it...
I guess I could have read that correctly. I read APpend instead of PREpend. smh
Thanks a lot!


#4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.