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

Alignment off

I am a novice doing your rails programming course. I am looking at the edit form page and have realised that the alignment of the Email field is centred, while all of the rest is left aligned. I guess it has something to do with the 'Form_for' code but can't work it out.

The code is below. Could you advise please.

<h2>Edit <%= resource_name.to_s.humanize %></h2>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> <%= devise_error_messages! %>

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

<%# if resource.class.reconfirmable && resource.unconfirmed_email.present? %> <!-- <div>Currently waiting confirmation for: --> <%#= resource.unconfirmed_email %></div> <%# end %>

<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br /> <%= f.password_field :password, :autocomplete => "off" %></div>

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

<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> <%= f.password_field :current_password %></div>

<div><%= f.submit "Update" %></div> <% end %>

<h3>Cancel my account</h3>

<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>

<%= link_to "Back", :back %>

3 Answers

This is in the views/devise/regiostrations/edit.html.eb file.

Managed to get this sorted myself.