similar to: Problem with associating comments with blog posts on same page

Displaying 20 results from an estimated 700 matches similar to: "Problem with associating comments with blog posts on same page"

2008 Apr 14
2
Problems with nil object
Hi to all. I''ve a very big problem. I know this can seem very loing, but please, try to read it. I have a simply blog, with posts and their comments. I''ve two tables in my db, posts, with post id, text and comments_count to store the number of comments-children of each post (as recomanded to do in AWDWR); and the table comments, with comment id, post_id for the post
2010 Oct 16
0
HTML5 Data Attributes
Here''s a proposed patch to simplify HTML5 data attribute declaration: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5825-html5-data-attributes Any comments? As explained in the ticket: Specifying HTML5 data attributes for tags could be more streamlined. Right now you would use string keys and repetition. To create, for example, this: <div
2014 Mar 31
0
Unable to delete post in sample blog application
Hi All, I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000 Processing by PostsController#show as HTML Parameters: {"id"=>"2"} Post
2006 Apr 20
1
Returning Count from find_by_sql
I want to return an int from a find_by_sql call. But when I use that result to compare to another count the error tells me I have an array. MODEL: # Returns the number of comments in a specified post def self.find_count(post_id) find_by_sql(["SELECT COUNT(*) FROM commments WHERE post_id = ?", post_id]) end CONTROLLER: def test @post =
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe one of you guys can help me out. I''ll show my sweeper and then my log to show that it "should" be working. class PragmaticSweeper < ActionController::Caching::Sweeper observe Comment def after_save(comment) expire_page(comment.post_id) end private def expire_page(post_id)
2009 Apr 15
2
Getting Started with Rails - post_comment_url
Hi, Thanks for a wonderful Getting Started with Rails. I am up to the last section and just added the comments part. So while testing and looking over comments_controller.rb; I see the reference to post_comment_url calll where is this defined. Below is the message I am getting. Thanks ActionController::RoutingError (post_comment_url failed to generate from {:post_id=>#<Post id: 1, name:
2006 Aug 31
0
ActiveResource
I''ve been sitting on an ActiveResource patch for a few weeks, waiting to get some feedback from David. But, I see other folks like Jeremy are starting to use it, so I committed my patch: http://dev.rubyonrails.org/changeset/4890 It gets all the basic operations in working order, and adds support for prefixes. I wasn''t quite sure how to pull this off. Right now, I''m
2006 Oct 16
6
Rails AR/Oracle Unit Test: [5310] failed (but getting better)
"rick" has given AR/Oracle some love, but it''s still unhappy... http://dev.rubyonrails.org/changeset/5310 ------------------------------------------------------------------------ r5310 | rick | 2006-10-16 08:42:55 -0700 (Mon, 16 Oct 2006) | 1 line Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
1997 Sep 06
1
Scalability
Hi! To convince one of our customer to use samba, we need a good reference. In the survey I found an entry of the "Bank of America". If the entry is right they are using 1200 Samba servers with 15000 clients. Is that right? Is there any article or official statemant available, which is public available to convince the "decision makers". Who know other huge Samba
2006 Jul 03
0
Check if row already exists?
I''m working on a system that has a series od "bids" associated with "posts". Vurrently when a bid is placed I have it creating a new row each time in the "bids" table. The bids table has id, post_id, and user_id. The logic is to check to see if a bid already exists with a given post_id and user_id. If it does, then just update the "amount"
2007 Jan 01
0
Simple question on inserting child data
after doing a bunch of reading I have finally sat down to create a simple app to dirve home a lor of the concepts to which have been read. So I figured a simple blog app is the best way to do it. The bad thing is that I am already hung up when creating replies to a blog posting. I can''t figure out how to insert the post_id value into the reply table. When creating a reply the user is
2006 Jun 08
5
Displaying Calculation on Index
Hi, I am trying to create a simple point system and display the total on my index page. So I have my db basically setup like this: Posts id, body, created_at, user_id Post_points id, post_id, user_id, created_at, value So as you can see I am allowing other users to create points on the post and my db will store who gave the point as well. "value" is the point value which can
2009 Aug 16
5
any help with captcha in my comments ?
this is my error: Processing ApplicationController#create (for 127.0.0.1 at 2009-08-17 00:57:56) [POST] Parameters: {"comment"=>{"name"=>"asdasd", "body"=>"asdasd"}, "commit"=>"Add Comment", "post_id"=>"19",
2006 Jul 12
1
odd habtm behavior? or is it me?
Hello List, I''m a bit spent on this problem, and my code might be whack. I seem to be encountering a problem where the primary key on a join table is not being resolved correctly. I will elaborate after some code bits. I am creating the join table using migrations, and relevant model code is this: class Post < ActiveRecord::Base has_and_belongs_to_many :records
2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog. map.resources :posts do |posts| posts.resources :comments, :trackbacks end Now comments are at /posts/:post_id/comments. Okay but what if I want to list all the comments for all the posts. It should be at /comments, but that isn''t map that way. Can I map comments twice? -- Posted via http://www.ruby-forum.com/.
2006 Aug 05
0
Another generic CRUD controller
I''ve been using this template on most of my CRUD controllers. class CommentsController < ApplicationController meantime_filter :set_scope before_filter :find_comment, :only => %w(show edit update destroy) def index @comments = Comment.find(:all) end def new @Comment = Comment.new end def create @comment = Comment.create!(params[:comment])
2006 Jul 24
1
has_many + finder_sql
from the api I got: <pre> has_many :subscribers, :class_name => "Person", :finder_sql => ''SELECT DISTINCT people.* '' + ''FROM people p, post_subscriptions ps '' + ''WHERE ps.post_id = #{id} AND ps.person_id = p.id '' + ''ORDER BY p.first_name'' </pre> I would like to pass in the
2008 Jun 06
0
in_place_editor_field in Rails 2.0.2
I''m attempting to get an in_place_editor_field working in my index view. I have the following: index.html.erb <% for profile in @profiles %> <% div_for(profile) do %> <% @profile = profile %> <%= in_place_editor_field(:profile, :first_name) %> <% end %> <% end %> profiles_controller.rb def index @profiles = Profile.find(:all)
2013 Mar 11
0
Any interest in various features from "schema_plus" gem?
Hello (I''m new to this group so please pardon any inappropriateness), I''m a primary maintainer of the schema_plus gem<https://github.com/lomba/schema_plus/>, which adds some capabilities to rails'' schema definitions. The gem has been around for several years and is pretty reliable. I''ve been wondering whether there''d be interest in folding
2009 Sep 30
8
Cycle/Partials issue
First off, I''m fairly new to ruby on rails so this may appear simple but I''m just learning the ropes :) So I have a simple blog app where a post has many comments. The ''show'' view for posts renders a partial for each comment the post has. The css class of the containing div element is cycled using cycle(). The partial code is, <% div_for(comment, :class