Sha256: 63754b7d64c3dcebc9e791aa3b6a15f5a40be2a0bccbb230485ecbcc2c30bbe0
Contents?: true
Size: 523 Bytes
Versions: 7
Compression:
Stored size: 523 Bytes
Contents
class MainController < Controller def index @entries = Entry.all :order => 'created DESC' end def delete oid Entry.delete oid redirect :/ end def edit oid @entry = Entry[oid] end def create Entry.create request['title'], request['content'] redirect :/ end def save redirect_referer unless oid = request['oid'] entry = Entry[oid] entry.title = request['title'] entry.content = request['content'] entry.updated = Time.now entry.save redirect :/ end end
Version data entries
7 entries across 7 versions & 1 rubygems