Sha256: 9232850f746fd310b11289c551be3cf25fcb86b69426502a034258edf861b95c

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

class Entry
  attr_reader :body, :title
  def initialize(params)
    @body=params["body"].to_s
    @title=params["title"].to_s
  end
end

class Blog<HTTPController
  def initialize(app)
    super
    
    @tspace=app.cluster.getApp(:localTupleSpace)
  end
  def index(*s)
    @entries=@tspace.read(:entries)
    @entries||=[]
  end
  
  def add
    puts "ADD"
    entries=@tspace.lend(:entries)
    entries||=[]
    entries << Entry.new(params)
    @tspace.store(:entries,entries)
    
    redirect_to(url(:action=>:index))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
appswarm-0.0.1 apps/blog/controllers/blog.rb