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 trial

Ruby

Generating the Devise Views

I’m in the "Generating the Devise Views" section and my form does not look correct because there is no place for me to enter the; First name, Last name, and Profile name fields when refresh my html page. I have the above labels printing, however, there is no place for me to input the text. Please see my code below and let me know where I could be going wrong. Thanks!

This is from the new.html.erb file found in registrations:

<h2>Sign up</h2>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> <%= devise_error_messages! %>

<div><%= f.label :first_name %><br /> <% f.text_field :first_name %></div>

 <div><%= f.label :last_name %><br />
<% f.text_field :last_name %></div>

 <div><%= f.label :profile_name %><br />
<% f.text_field :profile_name %></div>

<div><%= f.label :email %><br /> <%= f.email_field :email, :autofocus => true %></div>

<div><%= f.label :password %><br /> <%= f.password_field :password %></div>

<div><%= f.label :password_confirmation %><br /> <%= f.password_field :password_confirmation %></div>

<div><%= f.submit "Sign up" %></div> <% end %>

<%= render "devise/shared/links" %>

2 Answers

Hi Kudzai!

I have done this SO many times and you may have caught it already, but take a look at your text_field tags.

Remember when using erb the = sign within the opening tag tells ruby to render the output. If you omit the <%= and just have <%, then the code will execute, but will not render in the html.

Hello Nicholas! Thank you for your response. I'm not sure how I had missed that. So your response was very helpful, I'm back on track now.