Displaying 20 results from an estimated 1200 matches similar to: "acts_as_commentable release"
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,
2006 Mar 31
2
"Owning" a polymorphic
I''m playing around with RoR and I''m having trouble figuring out how to
describe a certain relationship. I''m building a social networking site
where you have users who can comment on other users, photos, videos, and
blogs. I''ve figured out how to have a comment belong to a user or media
item through a polymorphic relationships but I dont'' know how to
2008 Oct 29
5
Polymorphic Associations with inheritance
I have two models, Article and Post, that has many Comments. However,
both Article and Post are inherited from a BaseContent class like so:
class Article < BaseContent
has_many :comments, :as => :commentable
end
class Post < BaseContent
has_many :comments, :as => :commentable
end
and here''s my Comment model:
class Comment < ActiveRecord::Base
belongs_to
2006 Jun 20
2
Converting from acts_as_tree to acts_as_nested_set
I''m currently using acts_as_tree to display threaded Comments on my
forums-like site. It''s waaay too slow to display a page with 1,000
comments, as it''s issuing a TON of selects.
I''m pretty sure I want to convert to the nested set model, using
acts_as_nested_set or acts_as_threaded. This should give me the
performance I''m looking for.
The problem,
2013 Feb 28
2
Create polymorphic resources
Hi
I have created a polymorphic association for comments since I need
commenting functionality on several models. The issue is that when I create
the comment in my Commets#create action, I really don''t know what type the
parent is of.
So, let''s say I have Foo, Bar and Comment. Comment have this:
belongs_to :commentable, polymorphic: true
And Foo and Bar both have:
2007 Sep 23
9
Code reviews: my dumb use of acts_as_commentable (newbie)
With the help of several heroes here yesterday I beat my way into a
working solution to adding comments to one or more models in my
application using acts_as_comentable. Great plugin, but my
implementation is lame. I need enlightenment.
I have users who log in. For several views I want to let them add
comments. Enter act_as_commentable which does just this -- it''s
polymorphic, so you
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
2009 Apr 20
3
xxx.valid? still true after xxx.errors.add(...)?
Hi all
I have the following code in my controller:
if @comment.valid?
captcha_url =
"http://captchator.com/captcha/check_answer/#{captcha_code}/#{@comment.captcha}"
result = open(captcha_url)
unless result.read == "1"
@comment.errors.add(:captcha, "Captcha wurde nicht korrekt
eingegeben")
raise "#{@comment.valid?}"
2009 Mar 11
12
Eager loading comments associated with user submissions.
Hey everyone,
I am working on an application that allows users to submit articles,
and also comment on those articles. Pretty much exactly like Digg.
Everything works fine except that when there are a lot of comments
there are a lot of database queries to both fetch the comments and the
users who posted those comments. I have used eager loading in other
parts of my application to reduce the
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 ClassMethods
def
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]
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
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
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
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
2010 Oct 11
5
Object lost in memory/trashed?
Hi,
I''ve got a problem on which I''ve spent many hours, and I can''t get a
clue on what is happening... I hope someone here will be able to help
me.
Here is the situation : my Rails app uses acts_as_commentable and
acts_as_bookmarkable on a Diagram model. Everything''s working OK
individually: I can create a comment on a Diagram, bookmark it, and so
on.
Now,
2010 Sep 11
10
Having difficulty with threaded comments, using acts_as_tree
I''ve been having problems making threaded comments for the last few
days. Mainly with creating children and displaying the children.
Currently, I have comments shown at the bottom of my articles show view.
The top level comments work, but I do not really know how to implement a
way for users to "reply" to the top level comments and take them to a
form (the comment
2009 Jul 20
0
Polymorphic Comment notification to Users?
Hi, my webapp has registered users and it has articles, blog posts,
gossips too.
For all these resources I''ve a polymorphic Comment model which is
listed below.
<pre>
id content commentable_id commentable_type user_id
created_at updated_at
1 Frist comment 2 Article
1 ....
2 Second comment 3 Post
2 .....
2006 Jun 28
3
couple newbie questions
Hello Folks,
I am starting out with RoR and just browsed through Dave''s book ? couldn''t
stop reading. I started building a prototype to get better hands on
experience and I have run into two simple issues that I am hoping will be a
quick answer for some of you experts out there.
*Issue 1:*
>From within a "companies" controller and list_companies.rhtml view
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/.