Displaying 20 results from an estimated 20000 matches similar to: "HELP with redirect_to!"
2006 Mar 17
1
RSS problem when trying to display ID - HELP
I want to append "#comment-1" or whatever, depending on the id to the
end of my xml.link(" ... /#comment-1") attribute in my generated xml.
Well, when I put:
xml.link(" ... /#comment-" + comment.id)
I get an Application error (rails) message when I look at the generated
XML. This is what I''m doing without the id on the comments (its working
fine):
2006 Mar 04
4
How to redirect_to the same page after comment posting?
How can I have the page redirect_to the same page after someone posts a
comment?
I know that you can do "redirect_to :action => ''index''", but the page is
located at this URL:
/posts/2006/02/01/individual_post/
So, the action is "individual" which is in the "posts" controller, but
there is a custom URL mapped for the URL shown above. How can
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
2006 Dec 30
1
redirect_to(:action => ''foo'') and return
I''m not sure why this is happening, but if I do this in a controller
unless @variation && @variation.quantity > 0
flash[:error] = "Sorry, that product is currently not available."
redirect_to(:action => ''error'') and return
end
rspec tells me
2)
ActionController::DoubleRenderError in ''The Carts controller with an
2008 Nov 05
3
Problems w/ before_filter getting ignored
Hello,
I''m setting up an authentication module that will be called from
application.rb. I want to save a rrequest.request_uri into a
session to be used as a place holder that
will take users back to the page they were on before they logged in.
I''m trying to call the store_location method for all methods EXCEPT
login by putting login in an except before filter.
For some
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
2007 Aug 15
4
nuby: how spec redirect_to at ApplicationController
Good morning rspec people!
Still rspec nuby: I must do something wrong obviously.
How can I spec about redirect_to at ApplicationController
describe ApplicationController do
it "method login_required should redirect to home path without login" do
pending "I tried to use controller.login_required.should be_redirected
and got NoMethodError with nil object
2006 Jun 02
0
redirect_to problem - not redirecting
I have an application which is to talk to the protx VSP server system.
In order for it to work I need to redirect to a url which looks like the
following :
https://ukvpstest.protx.com/VSPSimulator/VSPServerPaymentPage.asp?TransactionID={88F1532E3-17E8-410A-A688-1E1ABCDDD50}
(the above is not a valid transaction id just an example)
this is stored in a variable called next_url
so when I call
2007 Apr 02
2
redirect_to an uncertain hash
I am trying to deal with a redirection based upon what to do after a
session has expired. I take the params hash and stuff it into a new
session as part of the new login and then after login, I want to
redirect to this hash as though they were params again...
Thus I start by setting
session[:direct_to] = @params
And after I login, I want to redirect based upon the values in
2006 Mar 04
1
Saving current date/time upon comment submission - help!
I''m having trouble storing the date/time with my comments - I''m getting
the MySQL error "posted_at is null".
How do I setup my code to automatically store the current date/time in
the ''posted_at'' column of my ''comments'' table?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 08
4
Redirect to where I was
I wonder if there is a standard Rails way to redirect from an action
back to a previously viewed page. As a quick fix I created two little
methods in the controllers/application.rb. Does this seem like an ok
way to go?
Thanks,
Peter
class ApplicationController < ActionController::Base
def i_was_here
session[:i_was_here] = request.env[''REQUEST_URI'']
end
def
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 Jan 27
0
redirect_to(:action => ...) usage?
I''ve a number of places in my rails application where I have
redirects, but I find they are not always redirected. I think
part of the problem is that my understanding of pre-requisites
is insufficient. I''m not sure how to frame a search to get the
answer I need. I''m using Rails 0.14.3 under cygwin with ruby 1.8.2
How do I make sure that data received in @params[] on
2006 May 19
0
No luck with multiple before_filters
I''ve got these two lines set up in my controller
before_filter :check_authentication
before_filter :check_max_hands, :only => [ :play ]
Here''s the corresponding code for each
def check_authentication
unless session[:user] and authorize?(session[:user])
session[:intended_action] = request.request_uri
redirect_to :controller => ''user'',
2009 Jan 28
4
format.html and redirect_to
I was wondering what the purpose of wrapping a redirect_to in a
format.html block is. I get why you''d want to do this with a render,
but if you''re redirecting the browser to another URL, what''s the
point? As I understand it, when redirect_to is called, Rails sends a
302 back to the browser, so I''m having trouble understanding why
format plays any part in this.
2010 Apr 26
2
woriking under webrick but not under passenger
Hi!
I have just added login feature to my rails application (followed the
instruction from (Agile Web Development with Rails) but now I am getting
strange errors (looks to me like some kind of routing problem) under the
passenger/apache.
The error is:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
From the log:
2006 Feb 07
0
redirect_to and complex values
Guys,
I have a number of actions that need to redirect to the user (as opposed
to render) to an action so that a refresh won''t report the data.
However, these actions also need to pass a hash to the targeted actions
in the redirect.
Trying to do this with redirect_to paramters converts the Hash to a
String, which won''t work for me. For example:
2006 Jul 03
0
REST vs. render vs. redirect_to w.r.t. create error messages, efficiency and the desired URL
Hi,
Something has been bothering me for a long time and I''d like to know
what other think about this common situation with Rails.
Someone is looking at http://example.com/user/new where there is a
form that POSTs the data to the user/create action. The controller
might look like
def new
@user = User.new
end
def create
@user = User.new(params[:entry])
if @user.save
2007 Nov 02
4
Login Redirect - Hacking the session[original_uri]
Hi There,
I have several ajax elements that require authorization, but for various
reasons, they can''t pass session[original_uri] to the redirect on user
log in. I''m trying to hack in a uri by passing a param to the login
page.
I can see that the param is passing into the login page, but for
whatever reason, no matter what I do, the user is redirected to the
homepage after
2006 Jul 06
0
redirect_to in IE6
I''ve scoured through the forum and I haven''t found anyone else talking
about this problem. The login to my app directs authenticated users to a
home page using redirect_to. This works fine with firefox but for some
reason IE6 has a problem with. I have checked session info and that is
just fine but instead of redirecting to the specified page IE6
redisplays the login page.
As I