Displaying 20 results from an estimated 20000 matches similar to: "cache and exception safe around_filter (after_filter)"
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:
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 May 11
1
rendering in after_filter
Hi!
Is it possible to render the action within the after_filter method, or
is the rendering performed before?
I have something like this:
class FooController
after_filter :send
def a
@content=...
end
def b
@content=..
end
protected
def send
send_data(@content,...)
end
end
However, when calling the action a or b, the @content doesn''t get sent,
but instead
2006 Feb 20
3
Rewriting with an after_filter
All -
I''m completely new to RoR and also new to programming in an MVC
structure...
The Pragmatic Programmers guide to Rails says, temptingly:
"After filters can be used to modify the outbound response, changing the
headers and content if required. Some applications use this technique to
perform global replacements in the content generated by the controller?s
templates (for
2006 Sep 22
6
Using after_filter to control rendering on actions
I have a common failure page that I may need to render to upon failing
some test that occurs in an after_filter method.
I''d like to use the after_filter to take over the control of the
rendering, like so:
def test_for_validity
some_boolean = my_test
return render(:action => ''disqualified'') unless some_boolean
@success_controller ||= controller_name
2009 Jul 14
1
How to add after_filter-style render
Hello
I would like to execute specific action rendering something into page
after each of my ajax calls. In example I would like to update some
div or display an alert.
How I imagine it could work is as follows
class ApplicationController < ActionController::Base
after_filter :do_something_after_each_ajax_call
def do_something_after_each_ajax_call
if request.xml_http_request?
2006 Jul 22
0
how to apply before/after_filter to actionmailer
hi,
I want to perform some action before/after each email was delivered.
How can I apply before/after_filter to actionmailer?
Thanks.
Best Regards,
Zhenjian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060722/8f014133/attachment.html
2009 Feb 22
0
Using after_filter to remove image after render
Hi Everyone,
I tried doing this and it''s not working as I would expect it, but I''m
not sure if it''s even possible. I have an app that generates and image
on request and displays it to the user. To cut back on storage, and
some security, I''d like the app to receive the view request, render
the image, display it, then delete the file. I know this isn''t
2011 Aug 05
0
[LLVMdev] RFC: Exception Handling Rewrite
On Aug 4, 2011, at 4:03 PM, Peter Lawrence wrote:
> Bill,
> I believe the empty-exception-specification example is a red-herring,
> but that if you can construct an example where you think a landing-pad
> requires multiple filter lists then I think we can then have a productive
> conversation about it.
>
> I believe we can only get multiple filter lists in a
2011 Aug 05
3
[LLVMdev] RFC: Exception Handling Rewrite
Bill,
ooops, yes, I described the meaning of "throw(A)" backwards,
but I still
think my example shows why you cannot merge LandingpadInst while
inlining because multiple filter-lists on a LandingpadInst don't make
sense.
Perhaps I'm reading your original spec wrong, perhaps I'm mis-reading
Duncan's emails, but I read them to mean that your syntax supports
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
2010 Nov 25
0
[LLVMdev] RFC: Exception Handling Proposal II
Hi Renato,
>> OK :) Essentially what happens is as follows: when running destructors
>> when exiting a scope (which may be a nested scope), if a destructor throws
>> an exception then any remaining destructors are first run, then the
>> Program_Error exception is thrown at the point of the scope exit. This
>> may be caught by an enclosing handler.
>
>
2010 Nov 25
0
[LLVMdev] RFC: Exception Handling Proposal II
Hi Renato,
>> I don't understand what you are saying. Cleanups (e.g. destructors)
>
> Hi Duncan,
>
> Cleanup landing pads normally call destructors, but they're not a
> destructor themselves. I'm simply saying that compiler generated
> blocks (such as cleanups) should never depend on user variables.
I see what you are saying now. Unfortunately optimizations
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
2012 Jun 19
0
[LLVMdev] [LLVMDev] Object in a try-catch block not being destroyed even after an exception
On 6/19/2012 7:14 AM, SHIVA PRASAD wrote:
> Dear LLVM Members,
>
> The below source code from gcc test suite replicates the
> problem which i am facing. When it is built with clang, it throws an
> abort(highlighted).
> The following are my observations -
>
> 1. The object(tmp) is not getting destroyed immediately after the
> exception is thrown. In case of
2012 Jun 19
2
[LLVMdev] [LLVMDev] Object in a try-catch block not being destroyed even after an exception
Dear LLVM Members,
The below source code from gcc test suite replicates the problem
which i am facing. When it is built with clang, it throws an abort
(highlighted).
The following are my observations -
1. The object(tmp) is not getting destroyed immediately after the exception
is thrown. In case of Clang, the object is getting destroyed at a later
point of time.
2. In case of gcc, the
2005 Jun 24
3
flashing divs in IE with use of BlindUp and BlindDown
I''m having an issue with flashing divs in IE (firefox is fine and the
only other browser I''ve used)
My scenario is as follows. I have 2 divs (initially hidden) and using
the BlindDown and BlindUp functions (possibly others) the divs flash
when starting to roll down in BlindDown (due to the Element.show call)
and also at the end of the BlindUp call (due to the Element.hide call)
2011 Aug 05
0
[LLVMdev] RFC: Exception Handling Rewrite
On Aug 5, 2011, at 10:57 AM, Peter Lawrence wrote:
> Bill,
> ooops, yes, I described the meaning of "throw(A)" backwards,
I thought that might be the case. :)
> but I still
> think my example shows why you cannot merge LandingpadInst while
> inlining because multiple filter-lists on a LandingpadInst don't make sense.
>
> Perhaps I'm reading your
2006 Jul 10
2
Mongrel caching
I am using mongrel to serve static as well as dynamic pages.
The static page''s controller contains the following line of code:
after_filter {|c| c.cache_page}
This code caches that page as a static html page that does not have to be
rendered form multiple files (the view and layout). I got the idea to do
this form the rails recipes book. It definitely cached the pages. Wen I
make
2011 Aug 04
2
[LLVMdev] RFC: Exception Handling Rewrite
Bill,
I believe the empty-exception-specification example is a red-
herring,
but that if you can construct an example where you think a landing-pad
requires multiple filter lists then I think we can then have a
productive
conversation about it.
I believe we can only get multiple filter lists in a landing-pad if
we attempt
to merge exception-regions, and since filters are only an