Displaying 20 results from an estimated 1294 matches for "redirect_to".
2009 Apr 24
4
Undefined method "redirect_to" in before_filter
Code sample:
class SomeController < ApplicationController
before_filter do |c|
add_crumb "Blah", "/blah" #breadcrumbs plugin
redirect_to :controller => "foo", :action => "bar" unless c.send
(:has_package?)
end
# Rest of the controller...
private
def has_package?
# A bunch of logic work to check to make sure
# somebody''s session contains certain variables
# returns ONLY true or false.
end
The pr...
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 d...
2006 May 31
5
undefined method `redirect_to''
Hi all
I have followed this tute:
http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger
to get rails running and all is fine except for getting:
undefined method `redirect_to''
when I load my test page.
I have the following in my xx.rhtml:
<%= select :group, :user_id, find_all_groups, {}, {:onclick =>
select_group, :size => find_all_groups.size + 1} %>
and in my xx_helper.rb I have:
def select_group
redirect_to "http://www.rubyonrail...
2006 Mar 27
13
Is this a bug in Ajax handling?
When a controller responds to a link_to_remote with a redirect_to, the
link_to_remote gets a success callback, this would seem like a bug to
me, at a minimum it should return a failure?
This is driving me crazy because all the login engines/generators
respond to an authentication error with a redirect_to. The work around
is to change them to all do a
render :la...
2009 May 07
5
Controller redirect_to to leave iframe
Inside an iframe, I want the controller to redirect_to to the parent
(i.e. target =''_parent'').
Any ideas?
(Everything I''ve tried- via redirect_to - just keeps it inside the
iframe)
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 = {}, *parame...
2006 Jul 22
2
redirect_to error
Hi,
I have a redirect_to statement in a method that I would like to have
at the end of the method to take you to a ''Success'' page if
everything works.
When I hit the redirect_to statement, ( redirect_to :action =>
''show_success'' )
I get this in the browser:
Application error...
2006 May 31
5
Sharing code between some controllers? Staying DRY
Hi,
I have four controllers: one for the store front and three for the
store admin. In each controller I have copied and pasted exactly the
same code. It is a method called redirect_to() to override Action
Controller''s redirect_to(). Copy and paste is bad. I can think of two
options but I don''t know how Rails will feel about them.
Option 1: Can I create an intermediate controller class like the
following? If so, are their pit falls to this method?
class Applic...
2008 Jan 23
4
redirect_to broken?
Is ActionController''s redirect_to method broken by Facebooker? When I try to invoke it and execute through apps.facebook.com, I get a blank page returned, response code 200, no redirect. When I try to connect directly to the server (not through apps.fb), I get the infinite recursion error described minutes ago. Are any of you ab...
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
existing User should add items to the cart''
Render and/or redirect were called multiple times in this action.
Please note that y...
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, bu...
2007 Jul 26
6
response.should_not redirect_to
Hey,
May be it is just too deep night over here and I''m missing something
though I got this failure on {{{response.should_not redirect_to}}}:
''QueuesController should allow authenticated user to access ''show''''
FAILED
Matcher does not support should_not.
See Spec::Matchers for more information
about matchers.
Also I''ve found this in rspec_on_rails sources:
# response.should_no...
2006 Mar 24
6
login forms , redirect_to and ajax-scaffold problems
...s in application.rb
def authorize_employee
unless session[:employee_id]
flash[:notice] = "Please log in"
# save the URL the user requested so we can hop back to it
# after login
session[:jumpto] = request.parameters
redirect_to(:controller => "employees", :action => "login")
else
logger.info "User already authorized as #{session[:employee_id]}"
end
end
All standard stuff and works as expected most of the time.
Now the problem is that if the session expi...
2006 Aug 12
7
Redirect back to last page?
I have a few pages where a user may do something (add tags, login, etc)
and I would like to redirect them back to the last page they were at
before calling that action. Is there an easy way to do this?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 30
4
redirect_to("url") with post?
Is there a Rails-friendly way to redirect_to an url and post some
parameters with that?
I''ve tried:
redirect_to("http://whatever.com", { ''postme'' => ''this'' })
redirect_to("http://whatever.com", :post => { ''postme'' => ''this'' })
red...
2006 Apr 08
2
respond_to causes DoubleRenderError?
...in that redirects users to a login
site if they aren''t already authenticated and their session hasn''t
timed out. I had things working fine with straight http requests, but
wanted to add support for ajax requests. I thought this would be a
simple matter of replacing all of my "redirect_to <blah> and return
false" calls with something like "redirect <blah> and return false",
where the redirect method wraps a respond_to block. For example:
def redirect(url)
respond_to do |wants|
wants.html { redirect_to url }
wants.js { render :upd...
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 should. Does anyone have any ideas
on what could be causing this?
Thanks
jebw
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subs...
2006 Jul 07
4
need help with some ugly code - is there a better way?
...ntrollers: venue, band, fan):
def login
if request.post?
if session[:user_id] = User.authenticate(params[:user][:login],
params[:user][:password])
flash[:message] = "Login successful"
if session[:user_id].role == ''Fan''
redirect_to :controller => ''fan'', :action => ''profile'', :id
=> session[:user_id].fan.id
else
if session[:user_id].role == ''Band''
redirect_to :controller => ''band'', :action => ''pr...
2009 Sep 19
5
How to: redirect_to through a folder hierarchy (upwards)
Hi there,
how do I tell the current controller correctly to redirect_to an action
of another controller that is 1 level higher in the folder hierarchy
than the current controller?
How I have tried: Within the current controller (called ''incidents''), I
have put:
redirect_to :controller => ''members'', :action => ''show...
2012 Jan 19
4
redirect_to with a hash instead of parameters
All,
I have numerous places in my codebase like this:
redirect_to :action => ''schedule_by_uid_and_run_date'', :uid =>
@schedule.first.train_uid, :year => @date.year, :month => @date.month,
:day => @date.day
I''d like to replace the :year, :month and :day parameters with a hash
containing the three parameters. @date is...