Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndré Hatlo-Johnsen
1,170 PointsCant understand what objects it wants
Any help?
<%= form_for(@pet) do |f| %>
<div class="field">
<%= f.field :name %>
<%= f.text_area :name %>
</div>
<div>
<%= f.submit %>
</div>
<% end %>
Ethan Rivas
9,979 Pointswoodworth He needs it.
2 Answers
Ethan Rivas
9,979 PointsWhat asks the task?
woodworth
Front End Web Development Techdegree Student 19,831 PointsNo, my earlier answer was almost correct. You need to read the challenge questions closely, which I did this time. It just wants a simple form. Besides the (), there is no need to add <div> tags here.
Here's my final passing code for this challenge:
<%= form_for @pet do |f| %>
<%= f.label :name, 'Name' %>
<%= f.text_field :name %>
<%= f.submit %>
<% end %>
I usually name my labels -- which I did here with 'Name'. However, this should still work if you want to leave that off.
<%= form_for @pet do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.submit %>
<% end %>
woodworth
Front End Web Development Techdegree Student 19,831 Pointswoodworth
Front End Web Development Techdegree Student 19,831 PointsI haven't done this exercise, but I'm pretty sure you don't need () around @pet and this is what's causing the problem.
Check out the RailsGuide for examples: http://guides.rubyonrails.org/form_helpers.html