search for: comments

Displaying 20 results from an estimated 104096 matches for "comments".

Did you mean: comment
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 t...
2013 Jun 10
4
Combining CSV data
Hello R community, I am trying to combine two CSV files that look like this: File A Row_ID_CR, Data1, Data2, Data3 1, aa, bb, cc 2, dd, ee, ff File B Row_ID_N, Src_Row_ID, DataN1 1a, 1, This is comment 1 2a, 1, This is comment 2 3a,
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 amount of database queries, but when I apply the same practices in this situation it doesn''t seem to work. Here i...
2005 Dec 19
7
Error handling!
...l, I''m in the beginning states of learning ruby on rails development and have got to a part where I''m a little stuck! Basically writing a simple blog application, just to try something completely different! ;-) I have a page which displays the current blog entry, it''s comments and at the bottom of the page, a form to add a comment. So far, so good. It''ll add comments, list them etc. So I decided I need a validation routine going on and used "validates_presence_of :name" in my comments model. This is the problem I''m facing now. In past exam...
2010 Sep 17
25
Trying to look up comment through an ID, but failing
I am trying to allow users to reply through comments by allowing users to click a reply link next to the parent comment. It will send in a parameter to the ''new'' comment view, like so: | <%= link_to "Reply", new_comment_path(:in_reply_to => comment.id) %> The form will use the :in_reply_to parameter in order t...
2006 Jan 19
4
Relationships... not the personal kind!
Hello all, I''m very new to Rails and I love it so far. However, there are some things that aren''t so clear to me. Let''s say a blog post can have many comments, and a comment can only belong to one post. A user can have many posts and many comments as well. (this part makes perfect sense): class Comment < ActiveRecord::Base belongs_to :posting belongs_to :user end class Posting < ActiveRecord::Base has_many :comments belongs_to :user end...
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, polymorphi...
2006 Apr 07
3
Ajax render a template
In my blog a user can add comments. I want an Ajax call to add the comment to the bottom of the comments list. How to i return a comment thats is in the comment template and add it to the bottom of the page. I have gotten as far as rendering some text back to the form and the comment doesn''t display until i refresh....
2006 Apr 11
5
RJS adds comment but doesn''t update form
Hi, When a user adds a comment i want to add the comment to the end of the comments list using ajax so there is no full page refresh. The code i have below adds the comment to the database but doesn''t update the comments div with the new comment. Can anyone help? This is my first use of rjs templates and i have read http://www.codyfauser.com/articles/2005/11/20/rails...
2009 Feb 20
6
How to mock an object defined in the before_filter function?
...@comment.id #to be used in rendering partial @comment.destroy respond_to do |format| format.js end end def find_comment @comment = Comment.find(:first, :conditions => [''id= ?'',params [:comment_id]]) end ===============spec_file spec code describe CommentsController, "while deleting a comment" do it "should render destroy.rjs in case of success" do @comment = mock_model(Comment) @comment.stub!(:id).and_return(1) @comment.stub!(:destroy).and_return(:true) controller.stub!(:find_comment).and_return(@comment)...
2011 Jul 11
2
best way to aggregate / rearrange data.frame with different data types
Hi, I have a data.frame that looks like this: Subject <- c(rep(1,4), rep(2,4), rep(3,4)) y <- rnorm(12, 3, 2) gender <- c(rep("w",4), rep("m",4), rep("w",4)) comment <- c(rep("comment A",4), rep("comment B",4), rep("comment C",4)) data <- data.frame(Subject,y,gender,comment) data Subject y gender
2006 Apr 26
10
save new model with child model
Hi, I am having a problem saving a new model that has an associated child model. If a new ticket is being created and will have one comment to go with it then I tried this in my action @ticket = Ticket.new(params[:ticket]) @comment = Comment.new(params[:comment]) @ticket.comments << @comment if @ticket.save @notice = "Ticket added. Thanks for contributing!" @ticket = Ticket.new @comment = Comment.new else @notice = "Sorry, unable to add ticket." end The save always fails because the comment d...
2006 Jan 04
5
help with link_to_if, I can''t make it work...
For the life of me I can''t get it to work. Here is an example of my syntax. I''m trying to make comment.name a link to comment.web_site only if there is a comment.web_site. Can someone please help? <%= link_to_if(comment.web_site.length > 0, comment.name, comment.web_site {"class" => "comment_by"}) %> -- Posted via
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 ju...
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 <...
2006 Apr 01
10
You have a nil object when you didn''t expect it!
Hi, I am creating a blog to learn ruby on rails. I have 2 different views/models/controllers, 1 called post and 1 called comments. How do i link a post from the views/post directory to the comments that belong to the post in the views/comment directory. This is the code in the post/show.rhtml <%= render :partial => "post", :object => @post %> <%= link_to ''Back'', :action => ...
2010 Oct 14
7
undefined method?
.... Firstly, I''m using rails 3, ruby 1.9.2 I have a controller with an index action This part works fine, but i am trying to add a comment form to the page that is rendered by that index action. Supposing my controller is named controller1, I began this process first with: rails g model comments name:string content:text rake rb:migrate Then I went on to define an action to create the comments: within contoller1_controller.rb I added ========= def new @comment = Comments.new respond_to do |format| format.html format.xml { render :xml => @comment } end end =...
2005 Mar 10
6
problems with ActionMailer
I''m having some problems with ActionMailer and I''m hoping that someone can help. I''ve followed the tutorial on "How To Send Emails With Action Mailer" <URL: http://wiki.rubyonrails.com/rails/show/HowToSendEmailsWithActionMailer >, I''ve generated a mailer -- "notifier.rb" -- and I''ve added the following method to the
2019 Nov 12
3
calls with comment attribute
In general R doesn't print the "comment" attribute of an object > structure(1:3, comment=c("a comment", "another comment")) [1] 1 2 3 but if the object is a call it prints it in an unusual format > structure(quote(func(arg)), comment=c("a comment", "another comment")) a comment another comment func(arg) What is the
2013 Aug 15
2
Samba4 and iptables
Hi everyone, I had posted recently about getting Samba4 to work on CentOS 6.4 but having changes only replicating in one direction, from the Win2k3 AD but not back to it. I solved the problem, this time, by disabling iptables. I find it a bit hard to understand. These are the rules I have set up: *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [52:5888] -A INPUT -m state