search for: acts_as_commentable

Displaying 20 results from an estimated 26 matches for "acts_as_commentable".

2006 Jun 26
5
How can I dynamiclly generate models?
I am trying to write a plugin, ''acts_as_commentable'', for my models - Image, Book, Music and so on, I do not want to use polymorphic association, so very model should have its own comment class. Here is my code acts_as_commentable.rb module Commentable def self.included(base) base.extend(ClassMethods) end module Cla...
2009 Dec 27
5
Difficulties in understanding Rail-Plugins in depth
Hi, i try to understand how plugins work in detail. Often you see stuff like: class Post < ActiveRecord::Base   acts_as_commentable end I wonder what''s happen all there. What kind of language-feature is behind this call "acts_as_commentable" ? In my opinion you need some kind of extend or include to extend the functionality of a model. And exactly this is which i found in a file of the plugin. http://gith...
2007 Feb 20
0
counter caching with acts_as_commentable
I find that my app is doing a lot of db queries to get comment counts for various objects, as I reference these counts frequenly in my views. This is using acts_as_commentable. Anyone have any tips for adding counter caching to acts_as_commentable? I assume this is possible with polymorphic associations? Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the G...
2011 Apr 18
2
acts_as_commentable validations
Hi all, I recently started back up with Rails and things are going well up until now. I''ve set up acts_as_commentable in my Post model and it''s working great. Problem is users are able to create a "blank" comment. I''ve added the following validations in the comment.rb file generated by acts_as_commentable to limit the comment length: [code] validates_length_of :comment, :minimum =>...
2006 May 15
33
acts_as_commentable release
I now have the acts_as_commentable plugin up on RubyForge. This plugin will allow you to add comments to any active_record object in your Rails application. So far the directions are simple, and there are only a few features: To install: ruby script/plugin install svn://rubyforge.org//var/svn/commentable/acts_as_commentable In t...
2008 Aug 30
4
acts_as_commentable: find Post by date of comment
Hello, I am using acts_as_commentable (related to Post) and I would like to know how to get the list the posts ordered by date of comment (i.e. post with recent comment first). in addition if a post has no comment, i would it to be inserted based on its creation date. Thanks for your help Nicolas --~--~---------~--~----~------------...
2006 Aug 19
0
acts_as_commentable api design
Would someone mind giving me some feedback on rendering threaded comments: http://io.urbanape.com/io-podcast-part-2-48kbps.mp3
2006 Aug 19
1
acts_as_commentable
Don''t think this got through last time. Would someone mind giving me some feedback on rendering threaded comments: http://pastie.caboo.se/9255
2010 Jan 22
0
Problem with acts_as_commentable Plugin
Hi, i''m trying to use the acts as commentable Plugin, bit it seems not to work: My Commentable Model is the Task Class. if i try to get the Comments of a Task Object , e.g. task.find(:first) task.comments it occurs this error: ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''comments.task_id'' in ''where clause'': SELECT * FROM
2006 May 11
9
acts_as_commentable plugin
I''ve just about finished up work on a plugin similar to acts_as_taggable, but for comments instead which would allow you to attach comments (possibly even a threaded discussion if conbined with acts_as_tree) to any object. Is there anyone that would be interested in it? I don''t want to go throug the trouble of finding some way to distribute it unless I know that there is a
2007 Sep 23
9
Code reviews: my dumb use of acts_as_commentable (newbie)
...<label for="comment">Body</label> <%= f.text_field :new_comment_body, :size => 200 %> </p> <%= submit_tag "Save Comment", :class => "submit" %> <% end %> </fieldset> My review.rb model has: acts_as_commentable # yeah, this seems fine attr_accessor :new_comment_title # do I really need this?? attr_accessor :new_comment_body # ditto attr_accessor :review_id # c''mon, this can''t be necessary! and my controller has def show_review @review = Review.find(par...
2009 Jan 02
5
Very odd NoMethodError/stack overflow....
I''m getting this very weird error and I can''t figure out what the problem is. I''m using acts_as_commentable. Basically, I have a partial with this code in it: <div id="<%= ''#{comment.commentable_type}_comment_# {comment.commentable_id}'' %>" class="comment"> <dl> <dt><%= link_to comment.user.login, profile_path(User.find (comment.user_id...
2008 Jan 08
1
add comments to ALL models (ie automatically add has_many)
I have the acts_as_commentable and a bunch of others added to pretty much every model, is there a way to automaically add these to EVERY model ? I tried the following but it fails with an error... ActiveRecord::Base.class_eval do has_many :notes, :as => :model_with_notes, :dependent => true end fails with.... /usr/lib...
2009 Apr 29
0
Polymorphic comments table needs associated model
Howdy, I''ve been banging my head on this problem for a bit. I''m using the acts_as_commentable plugin which works great. The scenario, I''m on the user''s dashboard and want to display comments with commentable_type = Venue. No problem. But, if I want to display the name of that Venue with the comment... big nasty. The polymorphic key is a composite key and rails doesn...
2009 Mar 15
3
Capistrano deploy errors
Hi, when I do cap deploy:cold I get this error: rake aborted! undefined local variable or method `acts_as_commentable'' for #<Class: 0x7fa1c34a2f10> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ base.rb:1833:in `method_missing_without_paginate'' /usr/local/lib/ruby/gems/1.8/gems/mislav-will_paginate-2.3.8/lib/ will_paginate/finder.rb:170:in `method_missing''...
2009 May 12
2
STI good or bad for my problem?
Hi. I am currently developing a small course system for student and teachers. The system is divided in sections and sections have many messages, comments, documents and schedules. Pretty easy to set up using ROR, just add some belongs_to and has_many relations. But everything becomes much more complicated when the section items (message, comment and so on...) all has comments. And they can also be
2012 Mar 07
6
Can't find the PostgreSQL client library (libpq)
When i try it start my ruby server i get a error that looks like rails server Could not find pg-0.12.2 in any of the sources Run `bundle install` to install missing gems. I dont know what to do Thanks for all the help -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2010 Sep 21
25
Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Hello, I''m working to install the acts_as_commentable plugin on my Rails 3 app. After adding "acts_as_commentable" to my book model, I then added a comment form on my book show view: <% form_for(@comment) do|f| %> <%= f.hidden_field :book_id %> <%= f.label :comment %><br /> <%= f.text_area :comment %>...
2010 Sep 12
11
Rails Commenting, Plugins?
Hello, I''m looking to add comments to records in my app like Books. So a user can view a Book and then comment on it... As a newbie, is this something that I should build from scratch, or are there any popular Commenting Plug-ins, (Ajax implemented) that might be worth utilizing? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Sep 06
1
Howto ? :: multi notes for same product in rails
Hi, I want to create multi notes for one item. How can I do so in Rails. Steps I want. 1- create a new item 2- write in the edit screen name,desc,.... 3- Add some notes to this item ( from 1 to 20 notes) 4- Save the new item. Any good link or nice document ? Thanks Henrik E --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the