changeset 106:3ad8e6d20e79

Fix atom feed compliances - date format according to xml - no spacing for updated tag
author nanaya <me@myconan.net>
date Sun, 16 Oct 2016 05:45:21 +0900
parents ad464c8b6991
children de342c5df747
files app/views/tweets/_tweet.atom.erb app/views/tweets/show.atom.erb
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/tweets/_tweet.atom.erb	Sun Oct 16 05:39:59 2016 +0900
+++ b/app/views/tweets/_tweet.atom.erb	Sun Oct 16 05:45:21 2016 +0900
@@ -1,7 +1,7 @@
 <entry>
   <id><%= atom_id "#{tweet.user.id}/#{tweet.id}" %></id>
-  <published><%= tweet.created_at %></published>
-  <updated><%= tweet.created_at %></updated>
+  <published><%= tweet.created_at.xmlschema %></published>
+  <updated><%= tweet.created_at.xmlschema %></updated>
   <link rel="alternate" type="text/html" href="<%= tweet.uri %>"/>
   <title><%= ellipsize tweet.attrs[:full_text] %></title>
   <content type="html">
--- a/app/views/tweets/show.atom.erb	Sun Oct 16 05:39:59 2016 +0900
+++ b/app/views/tweets/show.atom.erb	Sun Oct 16 05:45:21 2016 +0900
@@ -8,9 +8,7 @@
   <title><%= "#{@user.name} (#{@user.screen_name})" %></title>
   <icon><%= @user.profile_image_url_https %></icon>
 
-  <updated>
-    <%= @tweets.first.try(:created_at) || Time.at(0) %>
-  </updated>
+  <updated><%= (@tweets.first.try(:created_at) || Time.at(0)).xmlschema %></updated>
 
   <%= render :partial => "tweet", :collection => @tweets, :cached => true %>
 </feed>