Changeset 1638

Show
Ignore:
Timestamp:
02/20/08 07:43:36 (3 months ago)
Author:
pdcawley
Message:

Tweaked the atom feed to use the proper namespace

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/models/article.rb

    r1587 r1638  
    1818  has_many :resources, :order => "created_at DESC", 
    1919           :class_name => "Resource", :foreign_key => 'article_id' 
    20    
     20 
    2121  has_many :categorizations 
    2222  has_many :categories, \ 
     
    2424    :uniq => true, \ 
    2525    :order => 'categorizations.is_primary DESC, categories.position' 
    26    
     26 
    2727  has_and_belongs_to_many :tags, :foreign_key => 'article_id' 
    2828  belongs_to :user 
     
    4747  def stripped_title 
    4848    str = String.new(self.title) 
    49      
     49 
    5050    accents = { ['á','à','â','À','ã','Ã','Ä','Â','À'] => 'a', 
    5151      ['é','Ú','ê','ë','Ë','É','È','Ê'] => 'e', 
     
    6262      end 
    6363    end 
    64      
     64 
    6565    str.gsub(/<[^>]*>/,'').to_url 
    6666  end 
    67    
     67 
    6868  def permalink_url_options(nesting = false) 
    6969    {:year => published_at.year, 
     
    404404 
    405405  def atom_content(xml) 
    406     xml.summary html(:body), "type" => "html" 
     406    xml.summary "type" => "xhtml" do 
     407      xml.div(:xmlns => "http://www.w3.org/1999/xhtml") {xml << html(:body) } 
     408    end 
    407409    if blog.show_extended_on_rss 
    408       xml.content html(:all), "type" => "html" 
     410      xml.content(:type => "xhtml") do 
     411        xml.div(:xmlns => 'http://www.w3.org/1999/xhtml') { xml << html(:all) } 
     412      end 
    409413    end 
    410414  end 
     
    413417    comments.build(params) 
    414418  end 
    415    
     419 
    416420  def add_category(category, is_primary = false) 
    417421    self.categorizations.build(:category => category, :is_primary => is_primary) 
  • trunk/app/models/content.rb

    r1637 r1638  
    279279 
    280280  def atom_content(xml) 
    281     xml.content html(:all), :type => 'html' 
     281    xml.content(:type => 'xhtml') do 
     282      xml.div(:xmlns => 'http://www.w3.org/1999/xhtml') { xml << html(:all) } 
     283    end 
    282284  end 
    283285 
  • trunk/config/routes.rb

    r1601 r1638  
    9494  date_options = { :year => /\d{4}/, :month => /(?:0?[1-9]|1[12])/, :day => /(?:0[1-9]|[12]\d|3[01])/ } 
    9595 
    96 #   map.with_options(date_options) do |dated| 
    97 #     dated.resources(:comments, :path_prefix => '/articles/:year/:month/:day/:title', 
    98 #                     :members => { :preview => :get }) 
    99 #     dated.resources(:trackbacks, :path_prefix => '/articles/:year/:month/:day/:title') 
    100 #   end 
    101  
    10296  map.with_options(:conditions => {:method => :get}) do |get| 
    10397    get.with_options(date_options.merge(:controller => 'articles')) do |dated|