similar to: How can I go back to where I was?

Displaying 20 results from an estimated 100000 matches similar to: "How can I go back to where I was?"

2006 Dec 27
5
redirect back to where I was before action?
For some reason I cannot find the documentation for this. How can I store the current URI/URL so that I can return with a redirect_to? session[last_action] = ??? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,
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
2009 Feb 15
1
How can I save the destination url with all the parameters?
I want too save the destination url with all the parameters (like some ids) in a variable session, so first I login the app and then redirect to this destination. How can I save this variable? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2008 Dec 03
2
Render and/or redirect were called multiple times in this action
I''m trying to add an application enabled/disabled flag in my application.. This is my code. [code=] # application.rb ... before_filter :check_enabled_flag private def check_enabled_flag application_flag = ApplicationFlag.find(:first) if application_flag.application_enabled redirect_to application_disabled_path and return end end[/code] and for some reason
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
2007 Jul 02
3
stupid Rails rendering
I dont'' understand why it''s not possible to have a conditional redirection in rendering respond_to do |format| format.js { render :update do |page| page.redirect_to posts_url if @located page.replace_html ''error_message'', "Error..." page << "$(''popup_error'').popup.show();"
2008 Jan 16
2
redirecto_to within helpers
Hi all, In one of my helpers I would like to call a redirect_to(url) action. I know the helpers are supposed almost only for formatting the view purposes but it''s the best way I have found to do what I want. If I call the redirect_to action in a helper I get the error: undefined method `redirect_to'' for #<#<Class:0x23aaedc>:0x23aaeb4> any solution for this?
2008 Aug 27
1
redirect with multi-dimensional parameter hashes
Hi, Is it possible to redirect passing multi dimensional parameters? I need to send params[:current][:selview] to another action mantaining the same data structure if I try as follows: redirect_to :controller=>"main",:action=>"inquiry",{"current"=>{ "selview"=>params[:current][:selview]}} I receive "syntax error, unexpected
2010 Mar 23
7
redirection in format.json ...
I have presently a render :json which modify the current page if @request.save format.html { redirect_to(@request) } format.json { render :json => { :result => ''success'', :request => request_path(@request) } } .... but I would like rather to redirect to an index page I wrote this but it doesn''t redirect ... format.json {
2006 Jun 01
3
how can i redirect a person after a login
i built my own login system, but unfortunately, i am having problems (ie, can''t really figure out how) to redirect a person back to the page he was requesting before logging in...say, as the admin i want to edit a certain message/logo, whatever, so i click on it, and i get redirected to my login page. after the admin logs in, he gets redirected to the homepage - i couldn''t
2006 Apr 01
3
Can I do a redirect in an ajax request?
I''ve got a form on my page, and when the user submits it, sometimes I''d like to update an element on my page, and sometimes I''d like to redirect the browser to another url entirely. However if I do redirect_to, it just updates the element with the results of the redirect. Is it possible to do what I want, or will I need to use RJS to do this? Pat
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 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
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.
2006 Oct 21
6
test_create gets 200 instead of :success
Help! I have a new/create process that works fine in the actual app. But when I test I always get a failure in the test_create section. Here''s some controller code: def new end def create begin @borrower = Borrower.new(params[:borrower]) if @borrower.save flash[:notice] = ''Borrower '' + @borrower.FirstName + '' '' +
2007 Oct 13
3
Endless Redirects with Ssl_Requirement
I''m running an application on mongrel with apache 2.2.3. SSL works fine when I enter an https manually. But when I use the plugin, I get an endless redirect. Got the same error when I tried running the following simplified version of SslRequirement from within an action: unless request.ssl? redirect_to "https://#{request.host}/#{request.uri}" end So there must be a
2007 Oct 08
2
flash messages?
Hello, I''m using flash[:hash] in my application, and I feel like I''m forced to make a redirect just to be sure that flash[:hash] doesn''t appear in any other views? flash[:notice] = "ASDDD" redirect_to :action => :another_method_name else flash[:error] = "DSADS" redirect_to :action => :same_method_name How do you solve this problem, to be
2007 Jul 24
2
Nested params and redirect_to
I have a simple client search screen that posts the following params: Parameters: {"search"=>"Search", "action"=>"list", "client_search"=>{"first_name"=>"jane", last_name"=>"smith"}, "controller"=>"client"} This works fine. However I want to redirect to the same
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
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'' }) redirect_to("http://whatever.com", :options