Displaying 20 results from an estimated 29 matches for "user_session".
Did you mean:
user_sessions
2010 May 21
0
Authlogic and Single table inheritance
Hi,
I have some models such as:
class User < ActiveRecord::Base
acts_as_authentic
end
class Admin < User
end
class Superadmin < Admin
end
And some controllers such as:
class UserSessionsController < ApplicationController
def new
@user_session = UserSession.new
end
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:notice] = t(''user_sessions.flash.create.notice'')
redirect_to root_path
else
render :action =>...
2011 Jun 29
6
RSpec with Rails 3.1rc4: spec test won't recognize <%= %> (should be simple)
In my user_sessions_controller:
class UserSessionsController < ApplicationController
before_filter :require_no_user, :only => [:create, :new]
before_filter :require_user, :only => :destroy
def new
@user_session = UserSession.new
@message = "Hello."
end
def create
@user_...
2010 Nov 14
5
Authlogic and rails 3 : NameError in User sessionsController#new
Hi everybody,
I''ve installed Authlogic on Rails 3 following the Railscast (http://
railscasts.com/episodes/160-authlogic), and the resources I was able
to find on the web, but I''m facing a problem.
Once I''ve generated the user_sessions controller and mapped the login
and logout routes, I get an error if I try to load the login page :
uninitialized constant UserSessionsController::UserSession
app/controllers/user_sessions_controller.rb:11:in `new''
The user_sessions model is really simple :
class UserSession < Authlog...
2010 May 25
2
Rails 2.3.6 and Authlogic 2.1.4 or 2.1.3
In the test environment, logging out and back in is not working for me. The
log for the first login looks like this:
Processing UserSessionsController#create (for 127.0.0.1 at 2010-05-24 19:53:57) [POST]
Parameters: {"user_session"=>{"remember_me"=>"true", "password"=>"[FILTERED]", "login"=>"test"}, "action"=>"create", "controller"=>"user_sessions"}
User Load (0.5ms) SELECT * FROM `users` WHERE (LOWE...
2010 Feb 16
0
Strange routing(?) Issue
...on=>"update", :controller=>"events"}
DELETE /
events/:id(.:format)
{:action=>"destroy", :controller=>"events"}
login /
login
{:action=>"new", :controller=>"user_sessions"}
logout /
logout
{:action=>"destroy", :controller=>"user_sessions"}
user_sessions GET /
user_sessions(.:format)
{:action=>"index", :controller=>"user_sessions"}...
2009 Dec 03
2
AuthLogic Question - one time password (persistence_token) - what config is required to use this???
...uthentic " in my user model per normal
* question: is "acts_as_authentic " required in each of my own models?
When I enter a URL in the browser directly to one of my own model
resources following the above I see in the logs:
(a) initial request - Redirected to http://localhost:3000/user_session/new
(b) and then for this redirect:
Processing UserSessionsController#new (for 127.0.0.1 at 2009-12-03
06:14:24) [GET]
Parameters: {"action"=>"new", "controller"=>"user_sessions"}
User Columns (3.4ms) SHOW FIELDS FROM `users`
User Indexes (0.9m...
2010 Nov 07
1
Strange authlogic logout behavior
...sing authlogic for my application''s authentication. If I decide
to login with an account and then immediately logout, I get an error.
Unknown action
The action ''show'' could not be found for UserSessionsController
The server log in development says:
Started GET "/user_session" for 127.0.0.1 at Sun Nov 07 13:28:31 -0800
2010
AbstractController::ActionNotFound (The action ''show'' could not be found
for UserSessionsController):
Rendered
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.1/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb...
2008 Mar 20
5
sharing story steps
Hi,
How can I have a common set of steps that all my stories share?
i.e. My stories often start out looking like this:
Given a user Joe
Given a user Jordan
then:
Given("a user $username") do |username|
@users ||= {}
@user_sessions ||= {}
@users[username] = create_user(:username => username)
@user_sessions[username] = login_as(@users[username])
end
I want to share that Given with all my stories. Or is there a better
way to do it?
Joe
2011 Jun 01
7
desperate, errors with file upload
hello,
i implementing a file upload using paperclip plugin. i getting the
following error [1] when uploading a file. I''m using the gems rails
v2.3.8 and paperclip v2.1.6. the parameter hash looks like [2], the
model like [3].
Interesting is that i get two different errors, on the localhost with
webrick it says:
Status: 500 Internal Server Error
no marshal_dump is defined for class
2009 Aug 02
13
NoMethodError in User sessionsController#create - Authlogic
...hing works fine,
except login in. After registration new user is automatically logged in,
he can edit his profile, but after clicking logout and trying to login
again I get error
NoMethodError in User sessionsController#create
undefined method `mb_chars'' for "rzepak":String
My user_session_controller.rb:
class UserSessionsController < ApplicationController
def new
@user_session = UserSession.new
end
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:notice] = "Successfully logged in."
redirect_to root_url...
2010 Jul 19
6
Setting a root_url
...url using map.root in "routes.rb".
The issue I''m currently having is as follows:
I walking through this Rails cast regarding Authlogic:
http://railscasts.com/episodes/160-authlogic
I decided that I make my map.root the "login" page, that is, the
index.html.erb of the user_sessions_controller.
So, what I did is typed the following in the "routes.rb":
map.root :controller => "user_sessions"
But, get the following: http://pastie.org/1050272
When I changed:
@user_sessions = UserSession.all
To:
@user_sessions = UserSession.find[:all], I got the foll...
2011 Jun 09
8
Fail to call
...trying create a user system for a future project but I have a
problem when I want give to my users the "Welcome". This is my code:
#application_controller
class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_user
private
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
@current_user = current_user_session && current_user_session.user
end
end
#welcome_controller
class WelcomeController < ApplicationController...
2009 Oct 18
4
NoMethodError in User sessionsController#new
...undefined method `require_no_user'' for #<UserSessionsController:
0x24fc700>
Error in terminal------------------
Processing UserSessionsController#new (for 127.0.0.1 at 2009-10-17
23:26:38) [GET]
Parameters: {"action"=>"new", "controller"=>"user_sessions"}
NoMethodError (undefined method `require_no_user'' for
#<UserSessionsController:0x24fc700>):
Rendered rescues/_trace (29.9ms)
Rendered rescues/_request_and_response (1.3ms)
Rendering rescues/layout (internal_server_error)
------------------------------------------
FYI----...
2010 Feb 20
23
Rails 3 possible bug in Routing
Hi, I just ran into this ActionController::RoutingError and just
wanted to check if someone can confirm this as a bug in the Rails 3
beta gem.
config/routes.rb contains:
get ''login'' => ''session#new''
post ''login'' => ''session#create'', :as => :login
GET /login works fine:
Started GET
2010 Nov 15
0
Problem testing Authlogic UserSession
...ting Authlogic 2.1.6, running under Rails 3.0.1., using rspec
2.1.0
I have the following:
user.rb
class User < ActiveRecord::Base
acts_as_authentic do |config|
config.login_field :email
config.ignore_blank_passwords false
config.disable_perishable_token_maintenance true
end
end
user_session.rb
class UserSession < Authlogic::Session::Base
end
user_sessions_controller_spec.rb
require ''spec_helper''
def user_session_create
@user = Factory.create(:user)
@user_session = UserSession.create(:email => @user.email, :password =>
@user.password)
end
describe User...
2010 Oct 14
7
undefined method?
I''m trying to learn rails as I go along, and having a bit of trouble.
There is an undefined method cropping that I don''t know why rails
thinks should be there.
Firstly, I''m using rails 3, ruby 1.9.2
I have a controller with an index action This part works fine, but i
am trying to add a comment form to the page that is rendered by that
index action.
Supposing my
2010 May 04
2
Session Store Issues on Production Server
...In other words, a user cannot log out. I have tried
implementing the Active Record session store and have changed
the :secret key in initializers/session_store.rb, but for some reason,
it is not resetting my users. Another interesting note is that in the
Appplication Controller if I force current_user_session to return
false, the user is logged out (of course). The problem seems to be
coming from user_session.delete.
Has anyone encountered this before? Is there something in Rack that
is holding this back?
Thanks!
--
You received this message because you are subscribed to the Google Groups "Ru...
2009 Oct 28
1
Using Cucumber with Lockdown
...am logged in as an admin and so should have
:all access rights, however I get the following error.
Authoriztion filed!
prms: {"action"=>"index", "controller"=>"admin"}
session: {:expiry_time=>Wed Oct 28 13:33:43 +0000 2009,
:access_rights=>["user_sessions/new", "user_sessions/create",
"users/new", "users/create"], "flash"=>{}, :return_to=>"/admin",
:session_id=>"14
ff27628c482546f0604f7d241c"} (SecurityError)
When I test it manually on the site everything works as expected....
2010 Jan 05
1
Errno::ENETUNREACH (Network is unreachable - connect(2)):
...9;
/usr/ruby-enterprise/lib/ruby/1.8/soap/rpc/driver.rb:232:in
`getEmail''
/usr/ruby-enterprise/lib/ruby/1.8/soap/wsdlDriver.rb:117:in
`__send__''
/usr/ruby-enterprise/lib/ruby/1.8/soap/wsdlDriver.rb:117:in
`GetEmail''
app/controllers/application_controller.rb:16:in `user_session''
/data1/src/ruby/passenger-2.2.7/lib/phusion_passenger/rack/
request_handler.rb:95:in `process_request''
/data1/src/ruby/passenger-2.2.7/lib/phusion_passenger/
abstract_request_handler.rb:207:in `main_loop''
/data1/src/ruby/passenger-2.2.7/lib/phusion_passenger/railz/...
2010 Oct 21
4
Authlogic + Rails3 - undefined method `Login' for nil:NilClass
...)
lib/active_support/notifications/instrumenter.rb:21:in `instrument''
Request Parameters:None
My gemfile reads:
gem "authlogic", :git => "git://github.com/odorcicd/authlogic.git",
:branch => "rails3"
config/routes.rb:
resources :users
resources :user_sessions
resources :ibe
match '':controller(/:action(/:id(.:format)))''
controllers/application_controller.rb: [the part that gets the current
user.. also taken from online examples]
def current_user_session
return @current_user_session if defined?(@current_user_session)
@cu...