similar to: Difference in redirect_to behaviour (Firefox, IE 7)

Displaying 20 results from an estimated 10000 matches similar to: "Difference in redirect_to behaviour (Firefox, IE 7)"

2006 Mar 30
1
flash, before_filter and redirect_to
I leave a notice in the flash and do a redirect from a before_filter. Can someone confirm that the first request after this, i.e. the page I redirect to, doesn''t/isn''t supposed to clear the flash? -- View this message in context: http://www.nabble.com/flash%2C-before_filter-and-redirect_to-t1367103.html#a3665933 Sent from the RubyOnRails Users forum at Nabble.com.
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
2005 Nov 08
2
Scriptaculous insertion fails when XHTML Strict used in FireFox
Hi ! I'm getting an uncaught exception requiring the Scriptaculous libraries when everything says XHTML 1.0 Strict: class ApplicationController < ActionController::Base before_filter :set_content_type protected def set_content_type response.headers['Content-Type'] = 'application/xhtml+xml; charset=ISO-8859-1' end end <?xml version="1.0"
2006 Mar 24
6
login forms , redirect_to and ajax-scaffold problems
Hi, I have a standard type authentication technique direct from AWDWR, so there is a before_filter :authorize_employee, :except => :login in my employees_controller.rb the authorize_employee is 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
2006 Aug 17
0
redirect_to POST?
Is it possible to automatically direct someone to a POST? Whenever a user comes to my site, I''m automatically creating a user in the DB for that person, however I''m also trying to stick to REST principles otherwise. My idea was to have a before_filter :check_user that checked to see whether this user existed or redirected to a POST users_url() to automatically create the
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
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
2006 May 16
2
before_filter and the application controller
Hi there, I''m having a bit of an issue with my before_filter. I know that the filters put in the application.rb controller are global for all the controllers. In my application filter I''d like to allow access to the RSS feed method in a ''member'' controller and skip the login checks that the before_filters are currently performing. In my application my filters
2006 Apr 21
9
Yet another dry question..
One of these days I''ll figure this out, but in the meantime help me be a better programmer by eliminating some excess code: I''m trying to check to see if somebody trying to view/edit/update a product is the owner. In my scaffold I have this code that works: def edit @owner = Product.find(params[:id].to_i) if @owner.user_id == @user.id @product =
2006 Jul 18
6
before_filter chains and halting at an arbitrary filter
Hi--I''m trying to implement a 2-level authentication system, where I have one before_filter which does general user authentication, and another which does further authorization for a specific controller. I have it set up as follows: before_filter :authorize_level_2 prepend_before_filter :authorize_level_1 which causes authorize_level_1() to run, and then authorize_level_2().
2008 May 21
8
before_filter with multiple roles
I have multiple roles in my application. Now I want to block a method for all users except the administrator and a manager. When I do this: before_filter (:check_administrator_role), :only => [:administration] before_filter (:check_taskmanager_role), :only => [:administration] The user must have both roles. How can I change that to an "OR" combination? -- Posted via
2010 May 27
3
before_filter always running in test, not in development or production mode.
I''m using Shoulda and restful_authentication on Rails3 and whenever I run my tests a before filter for login_required is always triggered, despite my filter being set up as: before_filter :login_required, :only => [:update, :edit, :suspend, :unsuspend, :destroy, :purge] My test is this: context ''A guest to the site'' do context ''on GET to
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
2005 Nov 16
3
controller before_filter issues
Hi, Some controller filters: before_filter :require_logged_in, :only => [:create, :new, :confirm] before_filter :init_players, :only => [:create, :new, :confirm] The first one, you guessed it, redirects a user if he''s not logged in. Now when I hit this page and I''m not logged in, the 2nd filter gets executed and throws an error, because it depends on the user
2008 Jun 13
3
before_filter order of execution
Hi I''m trying to use before_filter to allow access to a site. Only logged in users can view any object in the controller, but only users with a access_level higher than 2 can view specific objects. My code is: ----------------------------------------------------------- IN USER_CONTROLLER before_filter :login_required before_filter :access_granted, :only => [:destroy, :new , :edit]
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
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day. Hopefully someone can help explain why before_filter isn''t working for my codes. In my Application controller, I have this: before_filter :login_required, :except => [:newacct, :create_newacct, :passwd_reset ] def login_required unless session[:user_id] flash[:notice] = "Please log in"
2006 Mar 21
13
"Remembering" link to redirect to after logging in
Hi, Suppose I have a resource such as http://localhost:3000/topsecret/data that requires the user to login first. What I did was make use of before_filter to check and see if the session variable is set with the logged in user''s id (similar to the example in "Agile Web Development with Rails"). However while the filtering function does work correctly in redirecting the
2011 Nov 12
4
No route matches [GET] "/microposts/304"
Hi all, I''m learning Rails by Example (chapter 11), by Michael Hartl ( http://ruby.railstutorial.org/chapters/user-microposts#top) but I got no route matches when I try to delete one micropost. the _micropost html is... <tr> <td class="micropost"> <span class="content"><%= micropost.content %></span> <span
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