Sha256: 420ebe04febb9e8ab21fca4db05069773c59c08ee16e0bae8aacea765a154cd4

Contents?: true

Size: 900 Bytes

Versions: 1

Compression:

Stored size: 900 Bytes

Contents

# code:
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: methods.rb 118 2004-11-01 10:13:42Z gmosx $

module P

# = ArticlesMethods
#
# Methods for the Articles part.
#
module ArticlesMethods

	# Add an article
	#
	def add_article(request)
		if request["add_article"]
			article = N::Article.new
			request.update_entity(article)
			article.save!
			request.redirect("index.sx")
		end
	end
	
	# Delete an article
	#
	def del_article(request)
		if oid = request["del_article_oid"]
			N::Article.delete(oid)
		end
	end

	# Add a comment
	#
	def add_comment(request)
		if pid = request["add_comment_pid"]
			comment = N::Comment.new
			comment.article = pid
			request.update_entity(comment)
			comment.save!
		end
	end
	
	# Delete a comment
	#
	def del_comment(request)
		if oid = request["del_comment_oid"]
			N::Comment.delete(oid)
		end
	end
	
end

end # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.3.0 examples/simple/lib/articles/methods.rb