similar to: <meta http-equiv="refresh" content="5"/>

Displaying 20 results from an estimated 800 matches similar to: "<meta http-equiv="refresh" content="5"/>"

2010 Jan 31
3
Append/Prepend to a template from controller method
I want a method in app/controllers/application.rb that can prepend/append text to whatever template gets rendered. Of course I can''t call render twice w/o getting a double render error, so is this possible? I want to redirect after a delay using a meta refresh. Here''s what I''ve got: app/controllers/application_controller.rb: def redirect_after_delay (url, delay)
2007 May 09
5
layouts + routes = confused
I''m new to RoR and the tutorials I''ve found on the web, while helpful, aren''t as "complete" as I''d like them. I understand the basics when it comes to layouts and routes, but I''m trying to get them to work together. MY first task was to implement a user authentication system (registration/login/logout/change_password). This works fine with
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
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
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/
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
2008 Apr 19
4
Is testing output within content_for possible?
I wanted to test that the links below were being rendered in the views. - content_for :sidebar do %ul.links %li= edit_link edit_admin_contact_url(@contact), "Contact" # view test it "should have the correct side bar links" do do_render response.should have_tag("ul.links") do with_tag("a[href=?]",
2007 May 23
4
content_for
Any ideas how I would go about writing specs for views which make use of content_for? I''d like, for example, to be able to specify that ABC view places XYZ in the sidebar, which I do using content_for(:sidebar). Am I missing something obvious? Kyle
2008 Jan 24
3
Help to spec a rails helper method that uses content_for
Hi guys, I am a Rspec newbie and am having problems creating a spec for a RoR helper method. I have in fact already implemented the helper method and am trying to create retrospective specs. I know its the wrong way to do it but I am still learning Rspec. In my view I have a call to a helper method. <% body_class "users" %> which sets a CSS class declaration in the content_for
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
My main layout includes separate content_for/yield sections for my header, sidebar, footer, and content. However, when running a view spec, the `rendered` variable seems to only contain a string of just the primary content and ignores the header/footer/sidebar as well as the rest of my layout file (the "render" call just returns my primary content wrapped in generic <html> and
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 Jul 13
5
Generic page element display initializer in a layout?
All, I''ve run into a snag. I need to handle the display of elements on my page and I want to use my Javascript event handlers on page load. However, my BODY tag is trapped in my generic layout. I''m thinking that I can put an onLoad on the BODY tag that will just call a Javascript method called initializePage() and then provide this initializePage() call in my specific page
2007 Jul 16
4
Accessing content_for html in view specs?
Hi All, Hope all is going well. I''ve got a few views that create some content using ''content_for'' blocks <% content_for :blah do %> ..... <% end %> Has anyone worked out a way to be able to access the html that''s generated inside those blocks? Since they''re not part of the view, have_tag('''') seems to miss them,
2008 Sep 17
2
Layouts and content_for
when i studied the tutorial about layouts & content_for from railscast.I need a clarification as per their tutorial. url:http://railscasts.com/episodes/8-layouts-and-content-for <!- projects/index.rhtml -> <% content_for :head do %> <= stylesheet_link_tag ‘projects’ %> < end %> <!- layouts/application.rhtml -> <head> <title>Todo List</title>
2010 Sep 02
5
Re: Exclude ActiveRecord in Rails3
What''s the best way to exclude ActiveRecord in Rails3? In Rails2, one could just do: *config.frameworks -= [ :active_record ]* in the configuration block in environment.rb. Is it possible in Rails3? Thanks. Anuj -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to
2011 May 26
8
Is there a way I can create a sub-layout with ERB?
I have 2 pages that have almost the same content except for stuff in the middle. I''d basically like to have a sub-layout that wraps the content that is different - exactly the way a normal layout file would. How can I call into a layout inside of erb? I''d like to do something like this: <%= render :sub-layout => "reusable-wrapper" %>
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
2010 May 05
2
Add method to get at captured content_for
In Rails 3 the only way to get for content captured with the content_for method in a view is to call yield from within a view. However, sometimes is it useful to get to this data from within a helper (for instance to provide a default value). Calling yield from within the helper method won''t work, and accessing the @_content_for variable directly is not encouraged. Proposed solution: add
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