examples/blog/lib/blog/controller.rb in nitro-0.10.0 vs examples/blog/lib/blog/controller.rb in nitro-0.11.0

- old
+ new

@@ -34,14 +34,23 @@ end entry.save! end + # example of action with parameter. The parameter + # request['oid'] is referenced by the oid method + # parameter. + + def myview(oid) + entry = BlogEntry[oid] + @out << entry.title + end + # example of generated view def list_entry__xml - @out << RssBuilder.render(@entries, :description => 'Blog entries', :link => context.host_url) + o.build_rss(@entries, :description => 'Blog entries', :link => context.host_url) end def new_comment comment = request.fill(Comment.new) @@ -54,10 +63,10 @@ end # example of generated view def list_comment__xml - @out << RssBuilder.render(@comments, :description => 'Blog comments', :link => context.host_url) + @out.build_rss(@comments, :description => 'Blog comments', :link => context.host_url) end def login if password = request['password'] if password == Blog.password