Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Trying to make comments plugin ...
Ruby Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
generators/comments
lib
tasks
test
views
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

Comments
========

The idea is to have "comments contructor", a set of plugins to make comments exactly that you need with configuration as simple as posible.
Currently there are basic comments functionality without any plugin.
Controller extensions are currently missing in this repository.


Example
=======

In order to use this plugin you need also install "belongs_to_anything" and "hash4hash" plugins from my repositories

script/generate comments migration
rake db:migrate

Put next code snippet in ApplicationController

  before_filter :save_comment_if_there_is_one
  def save_comment_if_there_is_one
    if params[:comment]
      result = Comments::Manager::create_comment(params[:comment])
      redirect_to :back if result === true
      if result
        @comment = result
      end
    end
  end

If you want to have comments associated with some controller action simply put 
<%= display_comments %> somewhere on the page. 

You can also use comments with activerecord instances.

@article = Article.first

<%= comments_for @article %>


Copyright (c) 2010 Olexiy Zamkoviy, released under the MIT license
Something went wrong with that request. Please try again.