I'm running devise with custom views, and my login
page was rendering perfectly before, but I just changed the name of the model from human
to user
, renamed the controller and the views, but it just refuses to render my view.
I don't get an error, my layout renders perfectly, but it doesn't yield the body for some reason.
Code
Here's my routes.rb
for Users
:
## devise controllers for users
devise_for :user, controllers: {
confirmations: 'user/confirmations',
passwords: 'user/passwords',
registrations: 'user/registrations',
sessions: 'user/sessions',
unlocks: 'user/unlocks',
# commenting the below because omniauth gem isn't installed
# omniauth_callbacks: 'user/omniauth_callbacks'
}, skip: [:sessions]
## custom routes for users
as :user do
get 'login' => 'user/sessions#new', :as => :new_user_session
post 'login' => 'user/sessions#create', :as => :user_session
delete 'logout' => 'user/sessions#destroy', :as => :destroy_user_session
get 'register' => 'user/registrations#new', as: :register
end
Here's my sessions_controller
generated by devise:
class User::SessionsController < Devise::SessionsController
...
# GET /resource/sign_in
def new
super
end
...
end
Here's my view:
<%= render layout: 'layouts/shared/left_logo_panel' do %>
<%= form_for(resource, html: {class: 'form'}, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field form-group">
<%= f.label :email %><br />
<%= f.email_field :email, class:'form-control', autofocus: true %>
</div>
<div class="field form-group">
<%= f.label :password %><br />
<%= f.password_field :password, class:'form-control', autocomplete: "off" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="field form-group">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end -%>
<div class="actions">
<%= f.submit "Log in", class:'btn btn-default' %>
</div>
<% end %>
<%= render "devise/shared/links" %>
<% end %>
Log
Started GET "/login" for 127.0.0.1 at 2016-04-21 04:48:13 -0700
Processing by User::SessionsController#new as HTML
Rendered devise/shared/_links.html.erb (5.8ms)
Rendered layouts/shared/_left_logo_panel.html.erb (9.4ms)
Rendered user/sessions/new.html.erb within layouts/application (9.8ms)
Rendered layouts/_shim.html.erb (0.0ms)
Rendered layouts/_header.html.erb (0.3ms)
Rendered layouts/_footer.html.erb (0.0ms)
Rendered layouts/_ga.html.erb (0.1ms)
Completed 200 OK in 41ms (Views: 39.7ms | ActiveRecord: 0.0ms)
Aucun commentaire:
Enregistrer un commentaire