search for: topic

Displaying 20 results from an estimated 16654 matches for "topic".

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 dr_title, I should see an error message with the offending form item highlighted, correct? That doesn''t happen. It just goes on to the next...
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 o...
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 t...
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 <&lt...
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 with the names of each article below it. This app will not be use...
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 :topics do |t| t...
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 Category < ActiveRecord::...
2007 Sep 23
4
Story Runner, autoincrementing
...cord 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 I thought of using my named routes instead of specifying the path as a string. That worked up until the point when I reached: When "creating a new topic titled", "Nicks Mom" do |title| post topics(@forum, ??? ), :topic => { :title => title, :body => "She is teh hotZ!" } end The problem was since its a nested routed I couldn''t complete the post request without specifying the topic_id. But since the topic...
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...
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 Four\", created_at: \&quo...
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 to vie...
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", "Topic") form << collection_select("topic", "topi...
2005 Dec 17
3
Can scaffold generate listboxes in views? I''ve been unsuccessful.
...lled 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 test''. Here are my tables: CREATE TABLE topics ( id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL ); CREATE TABLE blogs ( id SERIAL PRIMARY KEY, title VARCHAR(100) NOT NULL, topic_id INTEGER NOT NULL REFERENCES topics(id), content TEXT NOT NULL ); Next, back in the test folder, I type ...
2019 Aug 22
4
Docs: Re-organizing the LLVM docs
...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 overview of LLVM * Topic links # Getting Started/Tutorials * Brief description w/topic links # Reference * Brief description w/topic links # Getting Involved/Community * Overview of how to get involved with the LLVM project * Topic links Due to the sheer number of topics, there would also need to be “sub-pages”...
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...
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 = U...
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 %&gt...
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 topics.category_id = categories.id", :conditions => ["topics.is_deleted != 1 AND...
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 dur...
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 topic than its name by \link[=dest]{name} which links to topic dest with name name. This can be used to refer to the documentation for S3/4 classes, for exa...