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 Build a Simple Ruby on Rails Application Customizing Forms Adding Styling

Thomas Vaeth
Thomas Vaeth
14,820 Points

Editing New User Page

<div class = "row">
  <div class  = "span4">
  <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "well"} ) do |f| %>
    <%= devise_error_messages! %>

    <fieldset>
        <legend>Sign Up</legend>
    <%= f.input :first_name %>
    <%= f.input :last_name %>
    <%= f.input :profile_name %>
    <%= f.input :email %>
    <%= f.input :password %>
    <%= f.input :password_confirmation %>

    <% if devise_mapping.rememberable? -%>
      <div class="field">
        <%= f.input :remember_me, as: :boolean %>
      </div>
    <% end -%>

    <div><%= f.button :submit, "Sign Up" %></div>
  </fieldset>
  <% end %>

  <%= render "devise/shared/links" %>
  </div>
  <div class = "span8">
    <h2>Signing up is easy and secure</h2>
  </div>
</div>

I am having trouble with invalid email and password. Could someone help me?

Thomas Vaeth
Thomas Vaeth
14,820 Points

(Some things went missing like the end statements after i submitted the question even though I just copied and pasted the code)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

What kind of problems are you facing?

Thomas Vaeth
Thomas Vaeth
14,820 Points

When I register I get "Invalid email or password." I'm guessing I shouldn't be using f.input for email and/or password. And after I get that invalid message it takes me to the log in page and not back to the register page.

1 Answer

Thomas Vaeth
Thomas Vaeth
14,820 Points

I fixed it.

session_path(resource_name) needs to be changed to registration_path(resource_name)