What Christian means is something like:
Put this in your app/views/layouts/application.html.erb:
<%= yield :refresh_tag %>
And then you will need to call this in a view:
<% content_for :refresh_tag do %>> <meta http-equiv="refresh" content="5"/>
<% end %>
But this needs to be done in a view... unlike the requested
before_filter and after_filter.
You could set a variable in the before filter and wrap the code in an
if statement:
class ForumsController < ApplicationController
before_filter :refresh, :only => :show
# ...
private
def refresh
@refresh = true
end
end
Then in your application.html.erb:
<% if @refresh %>> <meta http-equiv="refresh" content="5"/>
<% end %>
-----
Ryan Bigg
Freelancer
Skype: radarlistener
MSN & Gtalk: radarlistener-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
On 14/09/2008, at 9:08 AM, Christian Rishøj wrote:
>
>
> You could use the content_for pattern. Set the header as he content in
> your filter, and output it in your view.
>
> Christian
>
> On Sep 13, 2:38 am, David
<passa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> 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: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---