Displaying 20 results from an estimated 10000 matches similar to: "request.referer"
2006 Mar 24
4
Newbie Question: How can I access the referer
Just wondering if and how I can access the referer from the controller.
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
2012 Aug 01
2
'redirect_to' taking infinite loop.
Hi,
The following controller method taking me into infinite loop. Once the
update action completes I want to reload the ''index'' page. May I know
why it is going into infinite loop?
def update
Device.find_by_id( params[:device_id] ).driver = (
params[:driver_id] == 0 ) ? nil : Driver.find_by_id( params[:driver_id]
)
redirect_to :action => :index, :tab =>
2006 Jun 28
2
Saving and reproducing a POST request.
Hi
I have an action which saves the originating resource from which it
was called, and returns to it later. This is done by setting:
session[:return_to] = request.referer
...
redirect_to(session[:return_to])
Which works great for GET resources. The problem is that POST
variables aren''t kept in request.referer, so this method fails when
the originating resource is a a POST.
2007 May 21
4
Spec''ing redirect with arbitrary parameters
I''ve got the following expectation:
response.should redirect_to(:action => "new", :video_id => "1",
:process_id => "2", :origin_id => "3")
that fails with this error message:
expected redirect to {:video_id=>"1", :process_id=>"2",
:origin_id=>"3", :action=>"new"}, got redirect to
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
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
2005 Dec 30
6
call a method once per page request
Hi,
I''m wondering if there is a simple solution to call a method once per
page request.
I tried to place my call in a before_filter in ApplicationController but
it''d called a second time if I use render_component from a view.
Seems to me that a hook should be added in Dispatcher#prepare_application.
Context: working on i18n, I''m trying to check lang either from uri,
2007 Dec 07
1
Ruby on Rails applications with Mongrel cluster
Hello All
I am trying to install 5 mongrel servers against my app. i am using
Vista. I found this article on a website.. but am stuck on one point.
here are some notes from article:
Now enable the needed modules (url rewriting, proxy, proxy_balancer e
proxy_http) by editing the httpd.conf file (under c:
\Apache_Software_Foundation\Apache2.2\conf, if you installed Apache in
its standard path).
2010 Mar 21
3
Error in the code Doube Render (colins')
Hi everyone, i followed colins example and it worked perfectly but now i
get this error
ActionController::DoubleRenderError in UserController#login
Render and/or redirect were called multiple times in this action. Please
note that you may only call render OR redirect, and at most once per
action. Also note that neither redirect nor render terminate execution
of the action, so if you want to
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
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
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 able to use redirect_to successfully, and if so, any ideas
2006 Jun 21
3
multiple apps one virtual host one domain
I''m trying to achieve the following:
Having a development server that runs multiple rails apps running wihout
creating a different virtual host for each apps.
my documentRoot is therefore /var/rails for my whole config
http://myserver/app1/controller/action -> (/var/rails/app1/...)
http://myserver/app2/controller/action -> (/var/rails/app2/...)
I''m under apache 1.3
mod
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
2009 Aug 06
13
Redirect after login
Hi,
I''m new to Ruby/RoR so please bare with me!
I''m trying to adapt a ruby setup where someone logs in to a bonjour
service via a web browser. I have the login screen which asks for host
and password. There is only one user per host and i can log in fine.
It''s suppose to redirect me to /list in my browser but
doesn''t. Once i''ve entered the correct
2009 May 15
13
How to calculate java method timestamp?
Hi,
I need help in calculating Java method time-stamp in following fashion.
Consider following method example.
long method3(long stop) {
try {
Thread.sleep(1500);
} catch (Exception e) {
}
//////////////////// real CPU intensive operation ///////////////////////////
for (int i = 1; i < stop; i++) {
stop = stop * stop * i;
};
2006 Feb 20
3
Background work
Greetings,
I''ve got a rails app which is basically an admin interface to a xml
dataset. Currently I''ve got rails rigged to call a function to spit the
entire dataset to file with every change. This would actually be ok, its
fairly infrequently updated, but when the dataset grows large the user sits
there waiting for it to dump with no feedback as to whats going on. Oh yes,
2007 Oct 11
3
Please Help.
Hi,
I want to use USDT in my java applications.
Please tell me how to achieve this.
I am comfortable with SDT in C application.
I am using Solaris Sparc10 with Generic_120011-14 version.
Do I need to update my machine for this?
Thanks,
Ajit
--
This message posted from opensolaris.org
2012 May 03
6
Hosting application on private network.
Hi,
I have a Ruby on Rails application. I am able to run it in my local
system using Apache2 server. I would like to host my application so that
all the systems in the private network 192.168.3.0/24 should be able to
access the web-application. My system private-ip is 192.168.3.57.
Please help me what all configurations do I need to do.
Thank you
Ajit
--
Posted via
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 an instance of a Date class,