Displaying 5 results from an estimated 5 matches for "blog_comment".
Did you mean:
blog_comments
2007 Feb 01
4
Automatically Indexing Associated Models
...comment does not get
added to the index and is therefore not ferretable. The desired behavior
is that when a comment is added to a blog, that the comment be
ferretable.
CURRENT SETUP
Blog (id, title, body, user_id)
BlogComment (id, blog_id, comment)
class Blog < ActiveRecord::Base
has_many :blog_comments, :dependent => :destroy
acts_as_ferret :additional_fields => [:blog_comments]
def blog_comments
self.blog_comments.collect {|comment| comment.body }
end
end
class BlogComment < ActiveRecord::Base
belongs_to :blog
end
CONTROLLER
[..]
if @blog.blog_comments << comment...
2007 Nov 12
7
schema_info always wants to be 3, even when set to 7
Hi all,
I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5
on Windows XP SP2 and Ruby 1.8.6
I have seven migrations. If I run them with an empty database, it
runs the first three, then halts. When I look in schema_info, the
version is 3.
If I run db:migrate VERSION=7, then it runs through the remaining 4
migrations, and the version is 7 in the DB.
2006 Aug 16
1
Creating a comments system for multiple types of content
...model_type: "news_item"
# This item is associated with party ID = 5
yet_another_comment:
subject: "this is yet another comment"
body: "and this is yet another content"
model_type_id: 5
model_type: "party"
# This item is associated with blog ID = 99
blog_comment:
subject: "this is a blog comment"
body: "and this is a blog comment content"
model_type_id: 99
model_type: "blog_entry"
Do you see what I mean? Wouldn''t this be beautiful? If I wanted to add
the party_report to it I only had to add the statement &qu...
2006 Sep 05
0
rake craziness with Migrate as a dependency
...reateCategories: migrating
================================================
-- create_table(:categories)
-> 0.0700s
== CreateCategories: migrated (0.0700s)
=======================================
== CreateBlogComments: migrating
==============================================
-- create_table(:blog_comments)
-> 0.0900s
== CreateBlogComments: migrated (0.0900s)
=====================================
== CreateSweepstakes: migrating
===============================================
-- add_column(:offers, "type", :text, {:default=>""})
-> 0.2810s
-- add_column(:offers, &q...
2006 Sep 07
6
form_for - Child object - how to set parent id
...ogs %>
<span class="blog_header"><%=h blog.title %></span>
<span class="blog_date"><%=h blog.date_entered.to_s(:long) %></span>
<span class="blog_body"><%=h blog.body %></span>
<div class="blog_comments">
<span class="blog_comments_count"><%=h
pluralize(blog.comments.size,"comments") %></h2>
<% for comment in blog.comments %>
<div class="comment">
<div class="comment_name">...