Changeset 4227
- Timestamp:
- 04/18/06 05:23:47 (2 years ago)
- Files:
-
- applications/molecule/app/controllers/entries_controller.rb (modified) (1 diff)
- applications/molecule/app/models/entry.rb (modified) (1 diff)
- applications/molecule/app/views/entries/_new.rhtml (modified) (1 diff)
- applications/molecule/app/views/entries/feed.rxml (added)
- applications/molecule/app/views/layouts/application.rhtml (modified) (1 diff)
- applications/molecule/config/routes.rb (modified) (1 diff)
- applications/molecule/test/fixtures/entries.yml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
applications/molecule/app/controllers/entries_controller.rb
r4219 r4227 30 30 end 31 31 32 def feed 33 @entries = @workspace.entries.find(:all, :limit => 25) 34 render :layout => false 35 end 36 32 37 private 33 38 def set_workspace applications/molecule/app/models/entry.rb
r4219 r4227 5 5 self[:summary].blank? ? content : self[:summary] 6 6 end 7 8 def to_atom(builder = Builder::XmlMarkup.new) 9 builder.entry do |entry| 10 entry.title(title) 11 entry.updated(updated_at.xmlschema) 12 entry.published(created_at.xmlschema) 13 entry.content(:type => "xhtml", "xml:lang" => "en") { entry.text! content } 14 end 15 end 7 16 end applications/molecule/app/views/entries/_new.rhtml
r4224 r4227 1 <% remote_form_for(:entry, :url => create_entity_url) do |e| %>1 <% remote_form_for(:entry, :url => { :action => "create" }) do |e| %> 2 2 <p> 3 3 <b>Title:</b><br /> applications/molecule/app/views/layouts/application.rhtml
r4219 r4227 3 3 <title><%= @workspace.title %></title> 4 4 <%= javascript_include_tag :defaults %> 5 <%= auto_discovery_link_tag :atom, feed_url %> 5 6 </head> 6 7 applications/molecule/config/routes.rb
r4219 r4227 3 3 map.resource :entry 4 4 5 map.feed 'index.atom', :controller => "entries", :action => "feed" 6 5 7 map.connect ':controller/:action/:id' 6 8 end applications/molecule/test/fixtures/entries.yml
r4219 r4227 6 6 summary: On the wonders of the world 7 7 created_at: 2006-04-15 14:15 8 updated_at: 2006-04-15 14:15 8 9 9 10 good_morning: … … 13 14 content: What a lovely morning 14 15 created_at: 2006-04-15 14:30 16 updated_at: 2006-04-15 14:30