search for: _comment

Displaying 12 results from an estimated 12 matches for "_comment".

Did you mean: comment
2009 Mar 11
12
Eager loading comments associated with user submissions.
...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 is what I am working with: I am using the "acts_as_commentable_with_threading" plugin that I forked from elight on github http://github.com/elight/acts_as_commentable_with_threading/tree/master the association that is created is as follows class Submission < ActiveRecord::Base has_many :comment_threads, :class_name => "Comment&qu...
2006 Apr 01
10
You have a nil object when you didn''t expect it!
...;post", :object => @post %> <%= link_to ''Back'', :action => ''list'' %> <h2>Comments</h2> <%= render :partial => "comment/comment", :collection => @comments, :id => @post.id %> This the code in the comment_comment.rhtml <div> <h2> <%= link_to comment.body, :action => ''show'', :id => comment.post_id %></h2> </div> I keep getting the "You have a nil object when you didn''t expect it!" error message. I have tried everything i can thi...
2006 Apr 07
3
Ajax render a template
...></p> <%= end_form_tag %> </div> This is my def in the blog controller t handle the creation of the new comment def comment Post.find(params[:id]).comments.create(params[:comment]) render_text "return the comment" end This is my partial to display a comment _comment.rhtml <div id="newcomments"> <div id="divcomment"> <p><%= comment.name %> Says:</p> <p><%= comment.comment %></p> <p id="dateformat"><%= comment.created_at.to_s(:long) %></p>...
2005 Dec 27
7
help remove duplication in my app
I''m porting an old site of mine into Rails and I''m running into some duplication that could / needs to be weeded out. For each of my actions, I have to wrap the view content in the following HTML: <div class="box"> <img src="/images/content-top2.png" class="border" /> <div class="visible"> # content
2010 Jan 21
1
Rgeneric.py assists in rearranging generic function definitions
I've attached a script I wrote that pulls all the setGeneric definitions out of a set of R files and puts them in a separate file, default allGenerics.R. I thought it might help others who find themselves in a similar situation. The "situation" was that I had to change the order in which files in my package were parsed; the scheme in which the generic definition is in the
2006 Feb 24
2
how to better generalize a tree?
first some background info: I have a blog application that has a comments table with the following columns: id parent_id post_id created_at body here''s my model: class Comment < ActiveRecord::Base belongs_to :post acts_as_tree :order => ''created_at'' def print_children (options={}) before = options[:before] ? options[:before]
2006 Apr 11
5
RJS adds comment but doesn''t update form
...> "post", :object => @post %> <hr/> <div id="comments"> <%= render :partial => "comment", :collection => @post.comments %> <p<%= render :partial => ''newcomment'', :id => @post %></p> <div> _comment.rhtml <div id="divcomment"> <p><%= comment.name %> Says:</p> <p><%= comment.comment %></p> <p id="dateformat"><%= comment.created_at.to_s(:long) %></p> <hr/> </div> blog_cont...
2006 Dec 20
4
undefined method `fullname' for #<User:0x357e380>, BUT works on first view?
...se the long post, but I wanted to make sure you have all the information.... I have a NewsModel that looks like this: class News < ActiveRecord::Base belongs_to :user validates_associated :user validates_length_of :title, :description, :minimum => 5, :allow_nil => false acts_as_commentable acts_as_taggable def self.find_recent News.find(:all, :order => ''created_at'', :limit => 10).reverse end end and a controller like this: class NewsController < ApplicationController def show begin @news = News.find(params[:id]) rescue Acti...
2005 Nov 14
0
in_place_editor_field inside a partial collection
...ditor_field" inside a partial collection? It''s working perfectly in a regular template, but the id part becomes blank when it''s inside a partial collection. article_controller.rb: class ArticleController < ApplicationController in_place_edit_for :comment, :body ... end _comment.rhtml: <li id="comment-<%= comment.id %>"> <%= in_place_editor_field :comment, :body %> </li> show.rhtml: .... <ol id="comments"> <% unless @article.comments == nil %> <%= render :partial => "comment", :collection => @artic...
2011 Dec 16
3
PROBLEN IN AJAX USING RJS
...= pluralize(@article.comments.size, ''comment'') %> <%#*</div>%> <div id ="comment"></div> <%= render :partial => "comments/comment", :collection => @article.comments %> <%= form_for(@comment, :url => user_article_comments_path(@user,@article), :remote => true) do |f| %> <div class ="field"> <%= f.label :comment %><br/> <%= f.text_area :comment, :cols => "60", :rows => "10" %> </div> <div class="action"> <%...
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, I''d like to have a list in the "show" view of a diagram, which shows all comments and a line per bookmark saying somet...
2007 May 15
5
Problem with RJS and/or Prototype.js =>ResponseText is blank
...or => "#ffffff" #, :endcolor => "#b1d0e9" The controller action looks like this def comment @comment = Comment.new(:text => params[:text]) @comment.user = User.find(:first) @comment.entry = Entry.find_by_identifier(params[:entry]) if (@comment.save) @latest_comment = @comment # render :partial => "/common/comments/comment", :object => @comment # This fails too else render :action => "show" end end The form looks like this <% form_remote_tag(:url => { :action => :comment }, :html => {:class => "m...