similar to: redirect_to and complex values

Displaying 20 results from an estimated 20000 matches similar to: "redirect_to and complex values"

2006 Feb 08
2
Idiomatic way to change partial''s behavior based on caller
Guys, I have a partial that is shared by many controllers, and this partial has a link that needs to do different things based on which controller calls it. So, the partial looks like this: <!-- _part.rhtml --> <tr> <td><%=part.number%></td> <td><%=part.associated_part_number%></td> <td><%=part.drawings%></td>
2006 Jul 17
0
respond_to and redirect_to
Hi, I have two controller actions like: def foo do_something respond_to :html, :js end def bar do_something_else redirect_to :action => "foo" end How can I get foo to return JS, when bar is called via AJAX? What I''d like to get is: bar is called via AJAX do_something_else is executed do_something is executed foo.rjs is rendered The ideal solution should
2010 May 04
3
Idiomatic looping over list name, value pairs in R
Considering the python code: for k, v in d.items(): do_something(k); do_something_else(v) I have the following for R: for (i in c(1:length(d))) { do_something(names(d[i])); do_something_else(d[[i]]) } This does not seem seems idiomatic. What is the best way of doing the same with R? Thanks. Luis
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
2006 Mar 16
2
question about ajax/rjs and redirection
i don''t even know if this is possible, so I''ll just ask. say I have a remote form. the form data gets submitted to the backend via AJAX. if there is a validation error in the form, i handle that on the AJAX side. however, if the form validates, I''d like to redirect the browser to a different page. Will a redirect_to work with an AJAX call or do I have to handle that
2006 Jan 16
1
redirect_to is not working with ajax forms
I''m having trouble using redirect_to in an action called by a remote_form_tag. The log shows the redirect, and rendering of the redirected page, but the browser won''t redirect. If I set :update in the form_remote_tag, the page that was supposed to be redirected to will replace the :update elements content, and crash FF1.5 Running edge rails, and utf8 encoding joshua
2006 Mar 09
3
redirect_to :back question
Hi! How to use this? I can declare it only inside a controller, so i tried to do add this to application controller: def back redirect_to :back end so i could call in all my views link_to ''back'', :controller => ''application'', :action => ''back'' but it doesn''t work - there are no errors, but i''m still on the same
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
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
2007 Jun 21
0
problem with redirect_to() and VirtualHost
I''m running into a problem with redirect_to() and Apache''s VirtualHost facility. I have probably have something set up wrong, but I''m not even sure how to approach the problem. Background: We have DNS set up to return the domain''s address for all sub-domains. So, "dig xyz.cfcl.com" returns the same IP address as "dig cfcl.com".
2006 Mar 04
0
HELP with redirect_to!
I''m having trouble redirecting back to the same page after a comment is posted. To post a comment, this is what I''m doing: #controller def comments content = Content.find(params[:id]) comment = Comment.new(params[:comment]) content.comments << comment content.save redirect_to ( :action => ''individual'', :year =>
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 Rails application failed to start properly" The development.log
2006 Jul 22
0
multiple return values in action web service
Hi all, Does anyone have any advice about returning multiple values from an ActionWebService? That is, I''d like to implement something like the following. api_method :do_something, :expects => [{:id => :string}], :returns => [{:return_code => :int}, {:return_text => :string}] The easy way to do it would be to
2009 May 01
0
redirect_to issue - lost port number
Hi all, I found an issue with "redirect_to" by accident and hoped someone could fill me in on what is happening. If I try to do a redirect to somewhere that doesn''t exist, the port number will be dropped from the url and I get a "Can''t connect to server" error. http://localhost:3000/some-folder/ redirect_to "beans" http://localhost/ I guess
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 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 May 12
0
redirect_to with hash vs string and docs
Hi, When I use redirect_to with a string (eg. redirect_to "http://www.yahoo.com"), the browser is sent a response with a header containing status 302. This is good for what I am doing. If I use redirect_to with a hash (eg. redirect_to :action=>''list''), the browser is sent a response with status 200 and the body contains the destination of the redirection. This
2007 May 03
3
0.9.2 redirect_to no longer accepts hash?
Why am I now getting these errors? expected redirect to {:action=>"index"}, got redirect to "http://test.host/authenticated_users" I know in the AuthenticatedUsersController, the redirect call is redirect_to :action => ''index'' So why should I have to convert this to a url in my specs?
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
2008 Feb 02
3
Question abt redirect_to..
I found a reference to using attachment_fu and followed the lead of it but having an issue with the redirect_to that renders the fb:render tag - In my form I''m setting the canvas to false, file is being uploaded / save fine but when I attempt to redirect: redirect_to :action => :new, :canvas => true Unfortunatly it looks like my callback URL is getting printed twice, e.g.