Changeset 1638
- Timestamp:
- 02/20/08 07:43:36 (3 months ago)
- Files:
-
- trunk/app/models/article.rb (modified) (6 diffs)
- trunk/app/models/content.rb (modified) (1 diff)
- trunk/config/routes.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/models/article.rb
r1587 r1638 18 18 has_many :resources, :order => "created_at DESC", 19 19 :class_name => "Resource", :foreign_key => 'article_id' 20 20 21 21 has_many :categorizations 22 22 has_many :categories, \ … … 24 24 :uniq => true, \ 25 25 :order => 'categorizations.is_primary DESC, categories.position' 26 26 27 27 has_and_belongs_to_many :tags, :foreign_key => 'article_id' 28 28 belongs_to :user … … 47 47 def stripped_title 48 48 str = String.new(self.title) 49 49 50 50 accents = { ['á','à ','â','À','ã','Ã','Ã','Ã','Ã'] => 'a', 51 51 ['é','Ú','ê','ë','Ã','Ã','Ã','Ã'] => 'e', … … 62 62 end 63 63 end 64 64 65 65 str.gsub(/<[^>]*>/,'').to_url 66 66 end 67 67 68 68 def permalink_url_options(nesting = false) 69 69 {:year => published_at.year, … … 404 404 405 405 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 407 409 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 409 413 end 410 414 end … … 413 417 comments.build(params) 414 418 end 415 419 416 420 def add_category(category, is_primary = false) 417 421 self.categorizations.build(:category => category, :is_primary => is_primary) trunk/app/models/content.rb
r1637 r1638 279 279 280 280 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 282 284 end 283 285 trunk/config/routes.rb
r1601 r1638 94 94 date_options = { :year => /\d{4}/, :month => /(?:0?[1-9]|1[12])/, :day => /(?:0[1-9]|[12]\d|3[01])/ } 95 95 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 # end101 102 96 map.with_options(:conditions => {:method => :get}) do |get| 103 97 get.with_options(date_options.merge(:controller => 'articles')) do |dated|
