Skip to content

rbritom/Simple_polymorphic_nested_comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

################
#    English   #
################

First of a series of projects that will serve as examples of simple Rails functionalities to new comers.

Goals:
  Add comments to several models.
  Allow reply.
  Nesting comments.
  Add some ajax.

Requirements:
  Jquery  (a javascript library that makes javascript related functions easy)
  Rails 3.0 and up  (previous versions will look different mainly in the routes section)
  awesome_nested_set  (a gem /plugin that makes dealing with nestind easy)

Note: at the moment awesome nested set has to be hacked to work with rails 3.0 so in this project is installed
as a plugin, and the following lines were edited:
  #89 changed: name_scope to scope and commented the :order options
  #90 changed: name_scope to scope and commented the :order options
  #567  removed:   ", nested_set_scope.proxy_options[:conditions]"




Setup:
  First , bundle install then migrate your database with rake db:migrate , then add some dummy data with rake db:seed.

Pendding:

  Commeting the code, and ajaxing the comments.

Observations:

  Never allow users to post comment without first verifying is they are humans.
  you can use recaptcha, and/or a publishing page in the admin seccion.


Read sequence:
    This is how you should read the comments to understand what is happening
      1- Article model, app/models/article.rb      
      2- Comment model, app/models/comment.rb
      3- routes file, config/routes.rb
      4- comments controller, app/controllers/comments_controller.rb
      5- articles controller, app/controllers/articles_controller.rb
      6- articles show template, app/views/show.html.erb

/******************Please**************************/
If there is a translation issue or if something is not clear notify

################
#    Español   #
################


El primero de una serie de proyectos, en los que se muestra como hacer tareas
comunes, para los que estan aprendiendo Ruby on Rails.

Objetivos:
  Poder agreagar comentarios a mas de un modelo.
  Poder responder a los comentario.
  Anidar las respuestas.
  Agregar ajax(actualizar una parte de la pagina no completa).

Requisitos:
  Jquery (una libreria de javascript the facilita mucho realizar tareas de javascript)
  Rails 3.0 and up  ( las versiones anteriores son un poco diferentes en la seccion de rutas)
  awesome_nested_set  (una gema/plugin que facilita trabajar con recursos anidados)


Nota: la gems awesome nested set cuando se hizo este ejemplo no estaba lista para
rails 3 asi que hubo que alterar las siguientes lineas:
  #89 cambie: name_scope a scope y comente la opcion :order
  #90 cambie: name_scope a scope y comente la opcion :order
  #567  quite:   ", nested_set_scope.proxy_options[:conditions]"


Setup:

  Primero , ejecuta bundle install luego migra tu base de  datos con rake db:migrate,
  depues llenala de datos de prueba rake db:seed.

Pendiente:

  No he comentado el codigo aún, ni he puesto ajax.

Observaciones:

  Nunca publiques el comentario directamente, se debe verificar primero que el vititante  es un humano.
  Lo normal es usar recaptcha, y/o una pagina de publiación en la sección de administración.

Secuencia de lecura:
    Lee en esta secuencia para entender mejor
      1- modelo Article , app/models/article.rb
      2- modelo Comment , app/models/comment.rb
      3- archivo de rutas, config/routes.rb
      4- controllador de comentarios, app/controllers/comments_controller.rb
      5- controllador de articles, app/controllers/articles_controller.rb
      6- plantilla show the articles, app/views/show.html.erb

About

Polymorphic comments that can have nested replies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published