What i do wrong here?


#1

@zystvan

could you please look this that if image_tag is built in, I wonder what i do wrong here. I marathoning thru this. Your help is much appreciated!

<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="destination">
  <div class="container">
    <div class="row">
      <div class="col-xs-12">

        <%= image_d d.image %>
        <%= d.name %>
        <%= d.description %>
        
        
      
      </div>
    </div>
  </div>
</div>

Unknown_attribute tag_id
Unknown_attribute tag_id
#2

@orouge

image_tag

Check that line in your code.


#3

@zystvan

Thanks for explanation. I have one more question. In the following example, why do we type @destination versus (just) destination or letter 'd'????? is "@" always used???

 <%= image_tag @destination.image %>
 <%= @destination.name %>
<%= @destination.description %>

#4

@orouge

why do we type @destination versus (just) destination or letter 'd'?

@destination is the name of the variable with the image, name, and description. If you named it @current_destination or @d or something else instead of @destination, your code would still work, although it wouldn't follow the standards I've seen (@something almost always represents the currently shown something)

is "@" always used?

When the variable is created in the controller file, yes, although if you rename the variable without it, your code will probably still work.


#5

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