search for: around_filters

Displaying 16 results from an estimated 16 matches for "around_filters".

Did you mean: around_filter
2006 Apr 03
4
Clearing out filters in ActionController
I want to run a single filter in my application.rb file, and then if a certain condition is true, end the action''s processing immediately. Right now I''m using prepend_before_filter to ensure that it gets run first, but some of my around_filters are still being processed. Is there a way that I can clear out all the filters that should be run? Basically it''ll look something like this: class ApplicationController < ActionController::Base prepend_before_filter :check_domain def check_domain unless valid_site? req...
2010 Jan 27
1
around_filter and with_scope
i got two controller (with restful actions) where my code is quite ugly and not very dry. every action looks quite like this: if @logged_user.has_role?("admin") User.find(params[:id) else @logged_user.group.user.find(params[:id]) this is a security check that enforce a simple spec: normal user should read/write information only about their group''s users, but
2006 Mar 21
0
cache and exception safe around_filter (after_filter)
Hi, I was wondering if there is a feature or construct in rails that is guaranteed to run after an action like an around_filter (or after_filter) but will still run regardless of a broken filter chain or thrown exception? Currently I have an around filter setup, and I really require the after part of the filter to run, although if the filter chain is broken via cacheing or an exception is
2007 Apr 23
0
request logging: around_filters can't see error responses!
Hello, I want to emit a structured log entry (in YAML) for every request that hits my Rails app. For example, an entry in this log would look something like: --- SYSTEM_TIME: 0.0166666666666667 USER_TIME: 0.0999999999999996 DB_TIME: 0.00247621536254883 REAL_TIME: 0.091976 STATUS_CODE: 500 SESSION_ID: 64ad46a8841c66bbf64e93335cedc50d REQUEST_ID: 32d6a42f-da58-43e2-ab27-09d3e2a775cb
2007 Aug 21
2
using restful_authentication current_user inside controller specs
I''m using restful_authentication in my app and I have the before filters in my application rhtml: before_filter :login_required around_filter :set_timezone around_filter :catch_errors Currently I have them commented out while rspec''in but I''ll need to add them in my specs. def create @ticket = Ticket.new(params[:ticket]) @ticket.user = current_user if
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around filter. I have defined expectations on the model classes, and ideally, I would add a further expectation for the scope. Is this already possible in some way? How would I go about adding support a scope expectation? Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/
2008 Sep 13
2
<meta http-equiv="refresh" content="5"/>
Do you know of any way for me to stick a meta tag in using a before_filter or after_filter or around_filter? <meta http-equiv="refresh" content="5"/> I have been trying to figure out out and just cannot make sense of it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
Hi folks - Seeing a weird problem and would love some help. It''s documented in http://pastie.org/278310 to be more readable. In short, I have a caches_page "action", :if => {stuff} but the :if is never being called - the action is just caching every time. (If I put a debugger call in the :if block, it never stops.) If I replace caches_page with caches_action, the if
2008 Mar 06
3
cache_sweeper
Hi, Why is cache_sweeper not a documented method? I was pretty sure it used to be, but I could be wrong. I can''t seem to find any information on it anymore in the online docs. As a side note, looking at the code for cache_sweeper it appears to only work with the :only option, not :except (ignores it)... what''s the reason for this? Thanks, Andrew
2006 Jul 17
1
:create paramaters don''t get through (scoped_acces plugin)
Hi all, I''m wrestling with the scoped acces plugin to generate object access controll, but the :create params don''t seem to get through. :find works great. This is the code around_filter ScopedAccess::Filter.new(Service, :service_filter) layout "settings" protected def service_filter { :find => {:conditions => ["business_id =
2006 Jul 02
11
Rails Plugin: meantime_filter for controllers (actions within blocks)
Hello, I just finished writing a plugin for Rails that I''m annoucing the first release here: meantime_filter. It is descibed at http://roman2k.free.fr/rails/meantime_filter/0.1.0/ rdoc/ (See the end of this message for getting it.) ABOUT THE PLUGIN It extends ActionController to add the functionnality of having filters run at the action call time. This new type of filter yields
2008 Jun 24
0
scoped_access plugin and 2.0
Hi It would seem that the scoped_access plugin from http://wota.jp/svn/rails/plugins/branches/stable/scoped_access is incompatible with Rails 2.0.2. /home/httpd/rails/demoone/vendor/plugins/scoped_access/init.rb:18:in `alias_method'' undefined method `prepare_application'' for class `Class'' ( NameError ) from
2006 Jan 12
3
How to Selectively Quite SQL Logging
I know about logger.silence but here is the issue: I''m comfortable with the way the user engine is working, but it generates quite a bit of SQL noise in the logs. I''d like, for that engine, to suppress the SQL logging. Code in it has return statements in conditionals, e.g., if !user? RAILS_DEFAULT_LOGGER.debug "checking guest authorisation for
2009 Feb 02
2
did_not_yield
Hello, I have some rudimentary code for loging into my app and database, it works ok (I think) but in Production, it does some strange things. I''ve reduce the problem to a more simplest approach, without rendering, simply creating a variable of what should do. Here is what I get in the log: Processing ScannsController#status (for 127.0.0.1 at 2009-02-02 14:24:25) [GET] Session ID:
2006 Apr 09
1
PageSweeper not working since upgrading to 1.1.1
Hi, I upgraded from 1.0 to 1.1.1, now my cache sweepers acts up. They worked perfectly before he upgrade, now I get strange errors. I have an empty controller, it looks like this: class PageElementsController < ApplicationController cache_sweeper :element_sweeper def element_container_show render :inline=>"" end end The sweeper looks like this: class
2007 Jan 31
7
GET request works via curl, crashes from Java
...t subject line is of course a severe truncation!] I''ve got a REST request that works fine from curl but causes a mongrel error when executed from a Java program. This all worked with fine with rails 1.1.6 and webrick. I''m trying to update the app to rails 1.2.1 (I need working around_filters). I''m running in development mode with mongrel 1.01 running on macosx 10.4.8 w/ruby 1.8.4, rails 1.2.1. When I do the following request with curl everything appears to work fine: curl -I -X GET -H ''Accept: application/xml'' http://localhost:3000/1/offering/84/bundle/1...