Displaying 20 results from an estimated 29 matches for "user_sessions".
2010 May 21
0
Authlogic and Single table inheritance
...ome 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 => :new
end
end
def destroy
current_user_session.destroy
flash[:notice] = t(''user_sessions.flash.destroy.notice'')
redirect_to new_se...
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_s...
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 < Authlogi...
2010 May 25
2
Rails 2.3.6 and Authlogic 2.1.4 or 2.1.3
...r 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 (LOWER(`users`.login) = ''test'') LIMIT 1
The test logs out and logs back in as a different user, the SELECT is not on
the login field, but with the id of the first user, like still logged in:
Processing UserSessionsControl...
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???
...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.9ms) SHOW KEYS FROM `users`
Rendering template within layouts/application
Rendering user_sessions/new
SQL (0.6ms) SELECT count(*) AS count_all FROM `users` WHERE
(last_request_at > ''2009-12-02 20:04:24'...
2010 Nov 07
1
Strange authlogic logout behavior
...Controller):
Rendered
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.1/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
within rescues/layout (0.9ms)
Now if I login and the click on some other links within the application
and then logout, the logout function works as it should.
user_sessions controller
[code]
class UserSessionsController < ApplicationController
before_filter :require_no_user, :only => [:new, :create]
before_filter :require_user, :only => :destroy
def new
@user_session = UserSession.new
end
def create
@user_session = UserSession.new(params[:us...
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
Hi,
I''m beginner in rails, and I wanted to add to my simple application
Authlogic. So I''ve watched http://railscasts.com/episodes/160-authlogic
and step-by-step done everything. And almost everything 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
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 follo...
2011 Jun 09
8
Fail to call
...ass WelcomeController < ApplicationController
def hi
@current_user
if (@current_user)
@welr = ''¡Bienvenido'' + @current_user + '' a nuestra web!''
else
@weli = "¡Bienvenido invitado, no dude en registrarse!"
end
end
end
#user_sessions_controller
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] = "Estás dentro de nuestro sistema"
redirect_...
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
...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 UserSessionsController do
before(:each) do
:activate_authlogic
end...
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
Hello,
I am using AuthLogic as my authentication gem. Everything is great on
my development server. When I upload to my passenger driven
production server at Dreamhost, the sessions are persisting
relentlessly. 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,
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)):
I am trying to run my first app on the Solaris server, in a production
environment. I get a network unreachable. Why? Does it belongs to
database.yml config?
Processing CategoriesController#index (for 10.3.70.129 at 2010-01-05
14:00:47) [GET]
Errno::ENETUNREACH (Network is unreachable - connect(2)):
/usr/ruby-enterprise/lib/ruby/1.8/net/http.rb:560:in `initialize''
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)
@cur...