Part 7 step 5 cant figure out


Feel like I'm going 1 step forward 2 steps back in this.

Can anyone help me with my code for this section i really don't understand it

<div class="container" >
     <%= image_tag t.image %>
    <%= form_for @destination do |t| %>
    <div class="field"> 
      <%= %>
      <%= t.description %> 

  <% end %>

Errors I'm getting are:
wrong number of arguments (0 for 1..2)
undefined method `name' for #


Hi James,

@destination should be in parenthesis (() after form_for like this: form_for(@destination) ...

Inside that, each thing should be in a separate <div class="field">, (or actions for the submit button) like this:

<div class="field">
  <%= f.label :name %>
  <%= f.text_field :name %>
<div class="field">
  <%= f.label :description %>
  <%= f.text_area :description %>
<div class="actions">
  <%= f.submit "Create" %>


Thank you that worked


When is it appropriate to use text_field vs text_area (or is this a CSS question)?

Thank you.


@micropro88447 text_field is for one (usually pretty short) line of text, like the title of a page or something. text_area is when you have an unknown, but possibly very long piece of text, like this post.
If something is stored as a string in the database, text_field is what you want, and if it's stored as text in your DB, text_area is what you should use.

I hope that helped you :slightly_smiling:

And no, it's not a CSS question. It's a cross between being a question about HTML elements (<input type="text"> versus <textarea>), and a question about Rails :slightly_smiling: