Displaying 20 results from an estimated 16734 matches for "topicalization".
2005 Dec 16
12
validates_presence_of not working
Hi,
I''m new to ruby and rails. I just created a simple update page and the
update works fine if all form fields are filled in. However there is one
field that should never be allowed to be blank. So I put this in my
model:
class Topic < ActiveRecord::Base
validates_presence_of :dr_title
validates_length_of :dr_title, :minimum => 1
So, when I submit the form with a blank
2006 Jan 22
11
ActiveRecord find
Suppose I have three tables - authors, posts and topics.
Every post have a topic and every topic has an author, so I have
posts.topic_id and topic.author_id. When the author is guest (not
registered), author_id is nil.
I need to find all the posts (in one query) where every post have all
the information of the topic and the auther, so if p is one of those
posts I could get the name of the
2009 Jun 27
6
User has many topics or subtopics
Hi,
So i have users in the system and i have topics. Topics also
have_many subtopics. What is the cleanest way to setup the AR
relationships if a user can either have_many topics or subtopics ?
Its basically a dual select box dropdown, where the second dropdown is
optional.
Is the best to have user_topics, and user_subtopics tables and manage
that way ? or combine into one table with STI
2006 Feb 13
4
activerecord << operator
Hello,
I am new here and actually I am writing my first RoR app.
My question is:
--------
class Topic < ActiveRecord::Base
has_many :messages
end
class Message < ActiveRecord::Base
belongs_to :topic
end
class ForumController < ApplicationController
def post
message = Message.new(params[:message])
@topic = Topic.find(params[:id])
@topic.messages
2006 Aug 17
0
super-newb needs help with has_many and other things...
I am brand new to oop and am having a difficult time getting my head
around some ruby stuff. In specific, I am trying to create a library
style app that lists topics, articles and comments. I have a table
called topics, a table called articles and a table called comments. My
models, controller and view are all listed below. What I want to happen
is to have the list view list each topic along
2006 Mar 31
2
A.R. Associations problem
Hello,
I''m learning A.R Associations by creating a simple forum that consists
of 3 tables: ahuthors, topics and posts. This is the schema:
class AddAuthorAndTopicAndPostTables < ActiveRecord::Migration
def self.up
create_table :authors do |t|
t.column :username, :string
t.column :email, :string
t.column :created_on, :datetime
end
create_table
2006 May 28
3
Working with topics and categories
Hello guys,
I''m a newbie in RoR and I have a problem. My DB structure is
======================================
topics table : id(int,11)
name(varchar,255)
categories : id (int,11)
topic_id(varchar,255)
name(varchar,255)
======================================
--Models:--
class Topic < ActiveRecord::Base
has_many :categories
end
class
2007 Sep 23
4
Story Runner, autoincrementing
I''ve written a story and I run into a snag.
I''ve written the create_forum method and told it to set the id to 1
but when it creates the forum the id is autoincremented.
My forums table is empty but the id keeps incrementing the newest record on
creation.
When I run the story it comes out as something like 59 which fails my story
because I''m asking it to look at /forums/1
2006 Jun 21
6
Sort table by child row property?
I''m building a simple forum system which features a topics and a posts
table. The topic model has a has_many association with the post model,
i.e.:
class Topic < ActiveRecord::Base {
has_many :posts
}
class Post < ActiveRecord:Base {
belongs_to :topic, :dependent => true
}
Now, I wish to sort the topics by the created_at property of the last
post, but I can''t
2009 Sep 14
5
Expecting field value and getting record
The following short console session illustrates the problem:
Loading development environment (Rails 2.3.2)
>> topic=BlogTopic.find(4)
=> #<BlogTopic id: 4, parent: 2, topic: "Topic Four", created_at:
"2009-07-13 21:31:22", updated_at: "2009-09-14 00:37:29">
>> topic.inspect
=> "#<BlogTopic id: 4, parent: 2, topic: \"Topic
2010 Dec 12
9
SPAM?
Received this email this morning. But I seem to be the last poster on that list and search says the topic doesn't exists. Is there a next page problem on the forum, or is it just spam?
Hello,
You are receiving this email because you are watching the topic, "The perils of GMAX" at WineHQ Forums. This topic has received a reply since your last visit. You can use the following link
2005 Jan 21
2
collection_select
I''m trying to use collection_select, but it''s not working as I expect. The
list populates correctly but the current value is not selected.
@question contains a topic (via topic_id), and @topics is the list of all
topics. Here''s my attempt to create a drop-down list of the topics.
form("question") do | form |
form << content_tag("b",
2005 Dec 17
3
Can scaffold generate listboxes in views? I''ve been unsuccessful.
I''ve created several different Rails applications but I''m running
into the same trouble with each one. Lets say I create an app called
Test. I type ''rails test'' and it generates the directory for me.
Now I edit my database.yml file. Then I create a database with
Postgresql by typing createdb test. Now I go into Postgresql by
typing ''psql
2019 Aug 22
4
Docs: Re-organizing the LLVM docs
As part of my Google Season of Docs project, I’ve been conducting a content
audit of the LLVM docs. My goal is to identify specific categories and
tasks under which the docs can be re-organized. One of my first suggestions
will be to turn the main index (llvm.org/docs) into a landing page of
sorts. Here’s an example of how the new index page might look:
# Welcome/About
* Introduction and
2010 Jan 27
2
has_many, through with nested models?
First the data model:
class Forum < ActiveRecord::Base
has_many :topics, :dependent => :destroy, :order => ''created_at
desc''
end
class User < ActiveRecord::Base
has_many :topics, :dependent => :destroy
has_many :comments, :dependent => :destroy
has_many :replies, :dependent => :destroy
end
class Topic < ActiveRecord::Base
belongs_to
2006 May 07
1
Find records not in join with has_many_and_belongs_to
I have a User and Topic model. A user subscribes to a topic, so there is a
many-to-many relationship between User and Topic. So my User model object
is using has_many_and_belongs_to :topics and vice versa. I want to find all
the topics that a user has *not* subscribed to. This is what I''ve got:
@user = User.find(params[:id])
@topics = Topic.find(:all,
:conditions =>
2006 Mar 10
4
problem when looping through habtm children in a view
I have this code in a view:
<% for topic in @topics %>
<%= topic.id %> <%= topic.dr_title %><br/>
<ul>
<% for doc in topic.child_documents %>
<%= doc.dr_title %><br/>
<% doc = nil %>
<% end %>
</ul>
<% end %>
Though the topic titles and IDs display correctly,
2006 Jan 02
6
Paginate with joins messing with id
Hi all,
Best wishes for the new year! :'')
I''m very new to Ruby and Rails, and I ran into a problem with the
"paginate" function. When I use the following method to get a number
of forum topics based on a category name passed via the URI:
@topic_pages, @topics = paginate :topics,
:joins => "INNER JOIN categories ON
2018 Apr 11
2
EuroLLVM "Round Table" topics
Hi,
We are looking for new "Round Table" topics (i.e. mini-bof topics -
formally known as hackers lab). The round table sessions are a great way
for us all to discuss face-to-face any burning topics. We have scheduled a
table after each BoF sessions so that people can follow up on those
conversation-topics. We will also setup round tables during the event when
there is interest (i.e.
2009 Sep 24
1
R v2.10.0: Doc clarification for cross references and where are we heading?
Hi,
in 'Writing R Extensions" of R v2.10.0, under Section
'Cross-references' (2009-09-07) it says:
1. "The markup \link{foo} (usually in the combination
\code{\link{foo}}) produces a hyperlink to the help for foo. Here foo
is a topic, that is the argument of \alias markup in another Rd file
(possibly in another package)."
2. "You can specify a link to a different