similar to: Rewriting with an after_filter

Displaying 20 results from an estimated 300 matches similar to: "Rewriting with an after_filter"

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
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 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
2006 Feb 16
10
Ruby class variables and access from view templates
I have an app that requires me to define a class variable (actually an array) in a controller and then access it from within a view. It seems that the class variables aren''t working right. Here is an example of what I''m trying to do. class DisplayController < ApplicationController @@thumbnail_array = Array.new ... def some_method @@thumbnail_array = SomeModel.find_all
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
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
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
2009 Apr 14
3
Problem cross-compiling on Ubuntu
I'm using Ubuntu 8.10 (Intrepid Ibex) and R 2.7.1. I've built a package from source (a modified version of gbm) and it contains some C++ code. I now want to cross-compile it to get a Windows version. I installed R using sudo apt-get update sudo apt-get install r-base sudo apt-get install r-base-dev So far as I can tell, I've also followed all the instructions in the guide
2007 Jan 20
4
Looking for player recommendations...
I'm looking for personal recommendations for low cost flash based players which support Vorbis (speex and flac support would be nice, but aren't mandatory). Solid support (no weird limits for low and high bitrates) is required. I'd be buying a fair quantity of them to give away as prizes and gifts. I'd rather purchase players which have native Vorbis support rather than buying
2006 Aug 01
8
Decoupled observers for controllers?
In the Rails Recipes book the recipe "Keeping track of who did what" explains how to do decoupled observing of models. In my application I''d like to do a similar thing but watching the controllers. For example, when somebody hits the login method of the Security controller, I''d like to make a note of it. In this case I could observe the User model and watch for
2006 Aug 06
1
How to use omega to search remote back end?
Folks, Having trouble getting this to work. OMEGA cgi is not reading my stub file properly because it is trying to read it as a directory instead of a file. Is there an easy fix? Here is a transcript. Thanks, OSC oscar@epsilon:/svr/xapian/beta$ ls -aFl total 21335200 drwxr-xr-x 2 oscar oscar 4096 Aug 6 10:15 ./ drwxr-xr-x 5 oscar oscar 4096 Aug 6 12:59 ../ lrwxrwxrwx 1 oscar
2006 Mar 10
3
WML sites
Hi all how to make a WML view for rails pages? I''ve tried to create like: <wml> <card> CONTENT </card> </wml> but my phone says unsupported content type... thanks -- Posted via http://www.ruby-forum.com/.
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:
2007 Nov 30
5
render_to_string in an after filter
I''m using render_to_string in an after_filter, which renders a partial that is sent to a web service. Here''s the code: class MyController < ApplicationController after_filter :post_to_webservice def show # show logic end def post_to_webservice stuff = render_to_string :partial => ''stuff'' webservice_post(stuff) end I get a DoubleRenderError in the
2007 May 15
1
Effect.dropout and Too Much Recursion Error
Hi, I need some help again. :-) I have "Too much recursion error" prototype.js line 1288, I heve this error when I try to use Effect.dropout (script.aculo.us) if I remove table ID, there is no error, and the effect works fine (remove the tr from table) But I need this ID assign to this table, as table ID is used by other effect (Builder.node) Please help .... Thanks YUAN Here is
2006 May 25
5
Is there a way to abstract the updating of other parts of the page after an Ajax request without putting using the standard view file?
Hey all, I''d like to abstract the process of updating different portions of the page after an Ajax request has taken place. Rather than simply putting the extra view logic in the standard rjs template, it seems to give better separation if there is a split between the core view logic (ie, inserting a row in a table), and updating any associated portions of the page. Is this possible? I
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
2005 Nov 03
9
[Idea] session-wide persistent variables
I was thinking about having instance variable stored and fetched from session container automatically before calling an action and after the action is finished. Using methodology of accessors it would look like: class MyController < ActionController::Base persistent_attr :person def alfa person = ''John Smith'' # render as usual view alfa.rhtml with anchor
2013 Feb 28
1
how to use before_filter to decrypt post data
hello, everybody. in ror, we can add a after_filter to a controller. def aes_encrypt response.body = AesHelper.aes_encrypt(response.body) end after_filter :aes_encrypt and all action''s repsonse int the controller can be encrypt. and my question is , how to decrypt data use before_filter, or anything else. ex: i want to post json data to /usr/register, the json data is
2007 Feb 28
1
One page in app keeps rendering as text/plain
Here''s what I get from wget -S: HTTP request sent, awaiting response... HTTP/1.1 200 OK Date: Wed, 28 Feb 2007 15:52:06 GMT Server: Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2 .8.28 OpenSSL/0.9.7a #<#<Class: 0x2a96d0b978>:0x2a96d0b928>Content-Type: