I have been following a tutorial that allows me to make login accounts. I am pretty sure I have followed all the steps but the form to make a new account won't display.
new.html.erb:
<% form_for @user, :url => account_path do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= f.submit "Register" %>
<% end %>
_form.html.erb:
<p><%= f.label :login %></p>
<p><%= f.text_field :login %></p>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.label :password, f.object.new_record? ? nil : "Change password" %></p>
<p><%= f.password_field :password %></p>
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation %></p>
The debugger spits this out when I go to /users/new
:
ApplicationController::current_user_session
Rendered users/_form.html.erb (3.0ms)
Rendered users/new.html.erb within layouts/application (9.8ms)
Completed 200 OK in 165ms (Views: 99.7ms | ActiveRecord: 0.0ms)
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2012-08-12 09:06:44 -0500
so, it is telling me that it successfully rendered but when I visit the link nothing shows up. Does anyone know why?
You need to use <%=
erb tags with any helper methods that generate output. This includes form_for and input tags.
<%= form_for ... %>
<% end %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With