need help with login from different controller / layout

20 views
Skip to first unread message

der_tom

unread,
May 9, 2012, 5:35:59 AM5/9/12
to plataforma...@googlegroups.com
hi,
i have devise going, but it it seems i cant login from my "home" layout, which is basically my landing/frontpage. it works when iget redirected to application layout and do the login there (users/sign_in)

here is my log in case it helps:
Started POST "/users/sign_in" for 192.168.1.3 at 2012-05-09 10:32:37 +0200
Processing by Devise::SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0HzDKk7kDIoOg74i/p8LyMpThEdLGguI3RgGEBy6FgY=", "login"=>"tom", "password"=>"[FILTERED]", "btn"=>"signin"}
Completed 401 Unauthorized in 4ms
Processing by Devise::SessionsController#new as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0HzDKk7kDIoOg74i/p8LyMpThEdLGguI3RgGEBy6FgY=", "login"=>"tom", "password"=>"[FILTERED]", "btn"=>"signin"}
  Rendered devise/_links.erb (5.2ms)
  Rendered devise/sessions/new.html.erb within layouts/application (84.9ms)
Completed 200 OK in 212ms (Views: 207.3ms | ActiveRecord: 0.0ms)



Started POST "/users/sign_in" for 192.168.1.3 at 2012-05-09 10:33:18 +0200
Processing by Devise::SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0HzDKk7kDIoOg74i/p8LyMpThEdLGguI3RgGEBy6FgY=", "user"=>{"username"=>"tom", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}


i also added this to my application helper since its what a common solutions seems to be:
  def resource_name
    :user
  end
 
  def resource
    @resource ||= User.new
  end
 
  def devise_mapping
    @devise_mapping ||= Devise.mappings[:user]
  end


appreciate every idea!

thanks
 

Reply all
Reply to author
Forward
0 new messages