clem_c_rock
February 7th, 2007, 02:38 PM
Help w/ feeds in Windows IE 6 and 7
Hello,
I'm trying to get my feeds working in Windows IE 6 and 7. I'm using the template method and my rss feeds don't respond at all when I click the feeds link and my Atom feeds only show the raw xml code.
Here's an example of my code:
The feeds template partial:
render :partial => 'shared/feed/news_page', :layout => false
And the Rss Feed template code
xml.instruct! :xml, :version=>"1.0"
xml.rss(:version=>"2.0"){
xml.channel{
xml.title("flavor: #{@flavor} *title1: " + @feed.title)
xml.link('url: ' + @feed.guid) if @feed.guid
xml.description('*description 1: ' + @feed.description) if @feed.description
xml.language('en-us')
for entity in @entities
xml.item do
xml.title('title 2' + entity.title)
xml.category(entity.title)
xml.description(entity.body) if entity.body
case @this_controller
when 'news', 'task'
@id_key = :id
@id_val = entity.id
when 'wiki'
@id_key = :title
@id_val = entity.title
end
logger.warn("(*logger_warn*) this_controller-->>#{@this_controller} || news pg id_key-->>#{@id_key}")
xml.link url_for :only_path => false, :controller => @this_controller, :action => @this_action, @id_key => @id_val
end
end
}
}
And the Atom Feed template code
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
xml.feed "xml:lang" => "en-US", "xmlns" => 'http://www.w3.org/2005/Atom' do
xml.title("flavor: #{@flavor} *title1: " + @feed.title)
xml.id( "tag:#{request.host},#{Time.now.utc.year}:#{@feed.t itle}/#{@feed.title.downcase}" )
xml.link('url: ' + @feed.guid) if @feed.guid
xml.author { xml.name "Author Name" }
if @entities && @entities.any?
@entities.each do |entity|
render(:partial => "shared/feed/entity", :locals => {:entity => entity, :xm => xml})
end
end
end
And the partial template code
xm.entry 'xmlns' => 'http://www.w3.org/2005/Atom' do
xm.title ( entity.title )
xm.author { xm.name "Author Name" }
xm.link("rel" => "alternate", "href" => url_for(url_for :only_path => false, :controller => @this_controller, :action => @this_action, @id_key => @id_val))
xm.content(render_body(entity), :type => 'html')
end
And the RSS link:
<img alt="Meta_feed" src="/images/space/meta_feed.gif?1169575771?1169575771" />
And the Atom link:
<a href="/page/news/rss">Syndicate</a><a href="/clem-rock-inc/news/atom">Atom</a>
Does anyone see any reason why this wouldn't work in these browsers?
Thanks,
Clem
Hello,
I'm trying to get my feeds working in Windows IE 6 and 7. I'm using the template method and my rss feeds don't respond at all when I click the feeds link and my Atom feeds only show the raw xml code.
Here's an example of my code:
The feeds template partial:
render :partial => 'shared/feed/news_page', :layout => false
And the Rss Feed template code
xml.instruct! :xml, :version=>"1.0"
xml.rss(:version=>"2.0"){
xml.channel{
xml.title("flavor: #{@flavor} *title1: " + @feed.title)
xml.link('url: ' + @feed.guid) if @feed.guid
xml.description('*description 1: ' + @feed.description) if @feed.description
xml.language('en-us')
for entity in @entities
xml.item do
xml.title('title 2' + entity.title)
xml.category(entity.title)
xml.description(entity.body) if entity.body
case @this_controller
when 'news', 'task'
@id_key = :id
@id_val = entity.id
when 'wiki'
@id_key = :title
@id_val = entity.title
end
logger.warn("(*logger_warn*) this_controller-->>#{@this_controller} || news pg id_key-->>#{@id_key}")
xml.link url_for :only_path => false, :controller => @this_controller, :action => @this_action, @id_key => @id_val
end
end
}
}
And the Atom Feed template code
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
xml.feed "xml:lang" => "en-US", "xmlns" => 'http://www.w3.org/2005/Atom' do
xml.title("flavor: #{@flavor} *title1: " + @feed.title)
xml.id( "tag:#{request.host},#{Time.now.utc.year}:#{@feed.t itle}/#{@feed.title.downcase}" )
xml.link('url: ' + @feed.guid) if @feed.guid
xml.author { xml.name "Author Name" }
if @entities && @entities.any?
@entities.each do |entity|
render(:partial => "shared/feed/entity", :locals => {:entity => entity, :xm => xml})
end
end
end
And the partial template code
xm.entry 'xmlns' => 'http://www.w3.org/2005/Atom' do
xm.title ( entity.title )
xm.author { xm.name "Author Name" }
xm.link("rel" => "alternate", "href" => url_for(url_for :only_path => false, :controller => @this_controller, :action => @this_action, @id_key => @id_val))
xm.content(render_body(entity), :type => 'html')
end
And the RSS link:
<img alt="Meta_feed" src="/images/space/meta_feed.gif?1169575771?1169575771" />
And the Atom link:
<a href="/page/news/rss">Syndicate</a><a href="/clem-rock-inc/news/atom">Atom</a>
Does anyone see any reason why this wouldn't work in these browsers?
Thanks,
Clem