Displaying 20 results from an estimated 100000 matches similar to: "RedirectBackError"
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
2011 Jun 05
1
Cancan redirect back at AccessDenied
Hello
I have a rails 3 app and I am trying to implement the redirect back
action at access denied for cancan.
If I try this in my application_controller:
rescue_from CanCan::AccessDenied do |exception|
redirect_to :back
end
It gives the following error:
No HTTP_REFERER was set in the request to this action, so
redirect_to :back could not be called successfully. If this is a test,
make sure
2007 Feb 18
2
SerializationTypeMismatch in Production Mode
In production mode, I keep getting this error the 2nd time it loads a
page with a serialized attribute:
ActiveRecord::SerializationTypeMismatch (answers_container was
supposed to be a Array, but was a NilClass):
/vendor/rails/activerecord/lib/active_record/base.rb:1964:in
`unserialize_attribute''
In development, it works fine. In fact, if I set to false
config.cache_classes in
2006 Mar 13
1
issue with redirect_to
Hi all:
I can''t make redirect_to to unlock the current iframe using {:TARGET =>
"_top"}. It always stays in the current frame. I checked the
redirect_to code, it seems the method does not use "target". here is the
source code of redirect_to from ActionController::Base
def redirect_to(options = {}, *parameters_for_method_reference) #:doc:
753: case options
2008 Mar 31
1
How to make a ajax (xhr) redirect?
Hi all,
In my application, I want seamless degradability so I use request.xhr?
to check whether a request is an ajax call. However here and there, I
need to use redirect_to - in this case the request is not xhr anymore,
and the check doesn''t work as expected. Is there a way to make xhr-
like redirect (which allow to get to another controller+action)?
Thanks,
- Chuong
2009 Aug 27
2
Setting @request.env["HTTP_REFERER"] in an integration test
Hi.
I would like to set @request.env["HTTP_REFERER"] in an integration
test, but due to its nature, I would naturally set this value to the
previousle request url. How do I do that.
Thanks.
Jarl
2008 Jul 12
1
Re: Re stful_authentication, Internet Explorer, and unwanted http basic dialog
I''m glad I found your post Joshua - it saved me quite a bit of time!
To get this to work for me however (IE6), I had to ditch the ||= and do
straight assignment:
request.format = :html if request.env[''HTTP_USER_AGENT''] =~ /msie/i
Joshua Doss wrote:
>
>
> Alter access_denied to add this line (right below "def access_denied"):
>
>
2008 Jul 20
4
how does request.host get set?
how does request.host get set? Is there a way to manually set the
value in request.host?
I have several application servers running rails, each has its own
internal address in the request.host, so when calling redirect_to or
url_for function, it uses the internal address which is not accessible
to the user.
what I want is to set request.host to return mysite.com, no matter
which application
2007 Nov 08
2
SystemStackError from redirect_to
Hi
I''ve got a straightforward piece of code in my controller which will
consistently produce a SystemStackError.
@newmessage = @message.reply(params[:newmessage])
return unless request.post?
if @newmessage.save
flash[:notice] = "Message Sent"
redirect_to :index
end
The error is occuring on the redirect_to line, if I comment that line
out then everything behaves as it
2008 Mar 16
3
undefined method `redirect_to'
Hi all. I''m getting the following error in my app:
undefined method `redirect_to'' for ActionController::Base:Class
I''m using Windows 2000, Rails 2.0.2 and resource_controller (from
James Golick).
My controller:
class CommentsController < ApplicationController
include ResourceController::Controller
belongs_to :post, :article, :photo
create do
2017 Mar 22
2
GSoC 2017: Letor Click Data Mining
Hi James,
> Isn't this from the query template, ie from the main web page of search
> results? (It might make sense from opensearch as well, though.)
Yes, you are right; it is the query template. The reason I said opensearch
template is that I haven't quite read all sections of the Omega docs and I'm
still in the process. Thanks for pointing that out.
I'm aiming to cover
2008 Jan 18
3
Please help
Hello all,
I have developed a RESTFul webservice in RoR. Here under is the controller
---------------------------------------------------------------------------------------------------------
class PeopleController < ApplicationController
def index
list
render :action => ''list''
end
# GETs should be safe (see
http://www.w3.org/2001/tag/doc/whenToUseGet.html)
2006 Jan 30
10
How do I get the the full URL of an incoming request
Hey,
Is is possible to get the full URL
(''http://www.sender-domain.com/links/list.html'')
from where a user was sent to my site
(www.my-domain.com/controller/action) e.g. by clicking on a link? (I
read about something called a ''request'' object, I don''t know what it is
or does, is that what I''m looking for?
I''m very new to Rails
2009 Feb 04
2
delete_if does not work on associations
I tried to user delete_if on an association:
class Group < ActiveRecord::Base
has_many :memberships, :dependent => :destroy
has_many :users, :through => :memberships
...
end
This is the controller method, trying to use delete_if. Although some
elements are removed (s2 < s1), the save method does not update the
association.
def intersect_or_remove_group
other_group =
2007 Sep 17
0
keep sessions while switching domains
Hello,
Our rails app has several domains. We are now implementing a single
https connection https://secure.domain.xx.
All other domains need to switch to that new secure domain in certain
circumstances.
We only have one ssl cert and it is not possible to create and use a
ssl cert for all domains!
Now when switching domains we loose the session, that was previously
used and I was not able to
2007 Jun 07
0
Functional Tests Fail - No URL can be generated for hash
Hi,
I''m just learning Ruby and Rails. I have developed a Rails application,
but not using the creation scripts that come with the rails
distribution. Consequently, no test scaffolding is available to me, and
I''m trying to write my functional tests from scratch.
I have what might be considered a standard plain old controller
(dashboard_controller.rb) that I''m trying
2007 May 03
2
Multiple Update Actions that are Relatively the same
Hi there,
I have 2 actions that are rather identical:
# Put /account/you/update_password
def update_password
@user = current :user
respond_to do |format|
if @user.update_attributes(params[:user])
format.html {redirect_to account_url}
else
format.html {render :action => "edit_password"}
end
end
end
# PUT /account/you
# Update
2006 May 26
1
Redirecting user on object.save failures
Hi,
I''m trying to create a chatboard (I call it my BoomBox, each post is
called a "boom") which appears on every page of a weblog I''m building. I
have a scaffold-built controller called Boom, and the form to post to
the BoomBox is written into my default layout. So, the form can be
viewed from several of my other controllers, in most of their actions.
The form
2010 Dec 01
10
How to Redirect from http://mysite.com to https://www.mysite.com on Herok
Hello I''m looking to learn how to redirect all non-www (mysite.com) to
https://www.mysite.com
I tried the following:
class ApplicationController < ActionController::Base
before_filter :check_uri
def check_uri
redirect_to request.protocol + "www." + request.host_with_port +
request.request_uri if !/^www/.match(request.host) if Rails.env ==
2007 May 30
0
Headers munged into RAW_POST_DATA
Hi,
we''re seeing a really weird problem in our production environment.
"Connection: Keep-Alive\r\n" is being pre-pended to the RAW_POST_DATA,
which makes requests error out. This bug is seen infrequently and
*seems* to be browser-related, although I can''t reproduce it using the
browser reported in HTTP_USER_AGENT.
Set up is a apache 2.2 -> hardware load balancer