Displaying 20 results from an estimated 9000 matches similar to: "redirection bug ?"
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi,
I just installed Rails 2.0.2
[root@mymachine easyx]# ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
[root@mymachine easyrx]# gem install rails --include-dependencies
Need to update 16 gems from http://gems.rubyforge.org
................
complete
Successfully installed rails-2.0.2
[root@remandev easyrx]#
But I''m getting this error in my restful_authentication
2008 Jun 13
3
before_filter order of execution
Hi
I''m trying to use before_filter to allow access to a site. Only logged
in users can view any object in the controller, but only users with a
access_level higher than 2 can view specific objects. My code is:
-----------------------------------------------------------
IN USER_CONTROLLER
before_filter :login_required
before_filter :access_granted, :only => [:destroy, :new , :edit]
2007 Feb 21
1
setting session data from a post
I''m using acts_as_authenticated, and I''m trying to run some tests where
the user must be registered. In the past, I''ve just included a user id
in the session data.
def test_login_loads_from_post_session
post :new, nil, { :user => 7 }
session = assigns(:session)
assert_equal 7, session[:user]
end
My assert statement seems to be failing because my session is
2005 Nov 25
0
Login Authentication working in IE but not in Mozilla
I have gone through the following site for the creation of my login
page:
To mention I am using Windows XP pfofessional running on WEBBrick server
http://wiki.rubyonrails.com/rails/pages/HowtoAuthenticate
The code is given in the following 3 steps:
1)The controller that needs protection:
class WeblogController < ActionController::Base
before_filter :authenticate
def index
# show
2006 Feb 28
1
Oracle OraNumber problem with Authentication. Please help!
I have added an authenticator using the instructions here:
http://wiki.rubyonrails.org/rails/pages/HowtoAuthenticate
The LoginController sets session["employee"] to an employee.
When i try to access the session["employee"] from another controller i
get this error :
"
TypeError (no marshal_dump is defined for class OraNumber):
c:/ruby/lib/ruby/1.8/pstore.rb:159:in
2013 Jan 18
1
redirect_to(session[:return_to]) vs session.delete
Hey all,
Recently I''ve been looking into on how to return back to a previous
referring URL and and the most common approach is:
redirect_to session[:return_to]
But some recommend:
redirect_to(session.delete(:return_to) || default)
How I understand it, in the second example we call session.delete so it
will clear the return path since we will no longer need it, and we also use
2006 Jun 28
2
Saving and reproducing a POST request.
Hi
I have an action which saves the originating resource from which it
was called, and returns to it later. This is done by setting:
session[:return_to] = request.referer
...
redirect_to(session[:return_to])
Which works great for GET resources. The problem is that POST
variables aren''t kept in request.referer, so this method fails when
the originating resource is a a POST.
2010 Feb 19
0
You are being redirected
I have done something to my application controller so that instead of
the redirected page itself am now seeing this as a response:
<html><body>You are being <a href="http://www.example.com/
welcome">redirected</a>.</body></html>
I do not know why this is happening or what I did to trigger this
behaviour. The API does not give me any clues as to
2007 Jun 29
0
acts_as_authenticated, reset_session, and redirect_back_or_default
Just a question and an FYI
I just installed rails and acts_as_authenticated and was setting up a
site. Everything works fine except that in the AccountController that
I generated the calls to the routine redirect_back_or_default don''t
work because the call just before it to reset_session clears the
session[:return_to] that the method uses to set where it will
redirect.
I ended up adding
2006 Apr 12
3
acts_as_authenticated trouble
First off, I''d like to address that I''m n00bs.
I''ve read the README and blogs associated with this plugin, and there
really isn''t too much documentation. I have the newest version of
rails,ruby, and acts_as_authenticated installed.
#The setup
I set up the acts_as_authenticated in the following manner.
*created a table called "accounts" in the
2006 Dec 01
0
You are being redirected message
Ticket #3082 details a fix to add a body to redirect pages. This seems like
an old patch, but only now is it biting me. I have an authentication scheme
like this:
class ApplicationController < ActionController::Base
before_filter :check_authentication, :except => [:signin]
def check_authentication
return true if session[:user]
session[:return_to] = request.request_uri if
2007 Feb 15
0
Error handleing with redirect_to
I''m sketching out a error handler, something like
if cando = false
redirect_to( :controller => Oops,
:action => ''accessdenied'',
:type => ''alarm'',
:message => ''no_permission_to_view'',
:return_to => saved_url,
)
else
....
end
Is this an
2007 May 23
3
User Login (process_login)
Hiya - before I start let me tell you i''m a Nuby on Rails.
I''ve created a user registration within my application that requires
email validation and that seems to be working fine.
I''m now creating the user login page and have the following code in my
UsersController:
def login
@user = User.new
@user.username = params[:username]
end
def
2007 Oct 16
6
Failure trying to test ApplicationController
I''m trying to write some tests for the ApplicationController as shared
tests that can be run in all of my other controller tests, but am getting
a nil.rewrite error. Below is what I have...
describe AccountController do
it_should_behave_like ''Application controller''
end
describe ''Application controller'', :shared => true do
it
2008 Apr 30
4
what is .....undefined method `authenticate'
def login_submit
if session[''user'']
@logged_in = true
else
@logged_in = false
end
@user = User.new(params[''user''])
if session[''user''] = User.authenticate(params[''user''][''username''],
params[''user''][''password''])
flash[:notice] =
2006 Apr 13
0
redirect_to or link_to mapped url. any other way than "../../smth"?
Hi all,
I''ve got my urls mapped so that http://myapp/url is the same as
http://myapp/start/show/url.
Is there any way to use "redirect_to" and "link_to" in this case?
Currently I just use redirect_to("../@url") but perhaps there''s some way to
make it properly, with :action etc.
sabon
-------------- next part --------------
An HTML attachment was
2006 Apr 23
2
Check if current route == some route
I have a before_filter in ApplicationController in which I want to check
if the current location is the same as a certain route, so that I only
redirect non-logged in visitors to the "join" page if they''re not on
that page already.
The code I came up with is a bit ugly:
redirect_to join_url unless (@logged_in or action_name == "join")
I''m pretty sure
2010 Jul 01
6
Close Modalpopup with RJS
hi guys:
I''m scratching my head on this one: I have a twitter app where I''m
trying to open a modalpopup with a twitter sign in, get them to sign in,
then close the popup and refresh the main window. My code however
refreshes the main window with the popup window result, which I thought
was really strange:
application.html.erb
function OpenModalPopUP()
{
2006 Apr 27
0
redirect_to is changing my webpage charset
Gents,
I just figured out that redirect_to do something with the HTTP headers.
Specially the Content-type and charset.
I mean:
I got diferent encodings (charsets) if I use
http://myapp.com/welcome/index or http://myapp.com/welcome/
Can anyone tell me how can I solve that?
[]s
Manoel Lemos
--
Posted via http://www.ruby-forum.com/.
2006 May 10
2
session[:return_to] for going back.
Hi,
Is session[:return_to] something Rails maintains to quickly go back to the
previous uri without having to keep track of the action name? Or, do we
have to actually set it in our actions?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060510/7e36a528/attachment.html