Sha256: 6726b074270661d38af618aa5c86899596a1d1c705244e05f6b8920a0ed64cbd

Contents?: true

Size: 965 Bytes

Versions: 26

Compression:

Stored size: 965 Bytes

Contents

module Blog
  class Comments < Controller
    map '/comment'
    helper :gravatar

    def index(id)
    end

    def show
      @pub_formatted = @comment.published.strftime(Blog.options.time_format)
      @id = @comment.id
      @author = h(@comment.author)
      @homepage = @comment.homepage
      @content = h(@comment.content)
      @href = @comment.href
      @gravatar = gravatar(@comment.email.to_s, :size => 80, :default => :wavatar)
    end

    def create
      @comment = Comment.new
      @entry = Entry[request[:entry_id]]

      if @comment.update(@entry, request)
        redirect @comment.href
      else
        render_partial(:form, :comment => @comment, :entry => @entry)
      end
    end

    def form
      @comment ||= Comment.new
      form_errors_from_model(@comment)
    end

    def edit(id)
      'TODO: not implemted'
    end

    def delete(id)
      login_required
      Comment[id].destroy
      redirect_referrer
    end
  end
end

Version data entries

26 entries across 26 versions & 4 rubygems

Version Path
Pistos-ramaze-2009.06.12 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.04.22 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.04 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.05.08 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.05 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.06.04 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.06.12 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.06 examples/app/blog/controller/comment.rb
manveru-ramaze-2009.07 examples/app/blog/controller/comment.rb
rjspotter-ramaze-2009.06.29 examples/app/blog/controller/comment.rb
rjspotter-ramaze-2009.06.31 examples/app/blog/controller/comment.rb
ramaze-2011.07.25 examples/app/blog/controller/comment.rb
ramaze-2011.01.30 examples/app/blog/controller/comment.rb
ramaze-2011.01 examples/app/blog/controller/comment.rb
ramaze-2010.06.18 examples/app/blog/controller/comment.rb
ramaze-2010.04.04 examples/app/blog/controller/comment.rb
ramaze-2010.04 examples/app/blog/controller/comment.rb
ramaze-2010.03 examples/app/blog/controller/comment.rb
ramaze-2010.01 examples/app/blog/controller/comment.rb
ramaze-2009.10 examples/app/blog/controller/comment.rb