Do you know of any way for me to stick a meta tag in using a
before_filter or after_filter or around_filter?
I have been trying to figure out out and just cannot make sense of it.
Do you know of any way for me to stick a meta tag in using a
before_filter or after_filter or around_filter?
I have been trying to figure out out and just cannot make sense of it.
You could use the content_for pattern. Set the header as he content in
your filter, and output it in your view.
Christian
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 %>
<% 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 %>
<% end %>
Ryan B.
Freelancer
Skype: radarlistener
MSN & Gtalk: [email protected]
On 14/09/2008, at 9:08 AM, Christian Rishøj wrote:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs