similar to: How To Remove Unnecessary Controllers?

Displaying 20 results from an estimated 30000 matches similar to: "How To Remove Unnecessary Controllers?"

2006 May 14
3
Strange Database Mapping Question
Dear Rails List, I am new on the list so will assume straight away that this question has been answered before. As I can see no immediate way of searching the list, I will ask the question. I apologize in advance for any disruption this may cause. Question time: I am trying to write a web application for the staff at my office to play a form of virtual Super14. Its a bit like any of the
2006 May 28
7
Join table not being populated
Hello, I have the usual Categories and Products table scenario, mediated by a Categories_Products join table. When I create a new Product and into a given Category, I notice that my join table is not being populated. Shouldn''t the join Categories_Products table be populated? Thanks, gk -- Posted via http://www.ruby-forum.com/.
2006 May 21
3
has_many :through with a polymorphic join
Hi, Four tables: users, user_counties, uk_counties and us_counties. Each user has many counties, and each county has many users, so I decided to make user_counties a polymorph, so it can have counties from different countries (each country requires a completely different set of tables with a completely different set of properties, that''s why there''s one table for uk_counties and
2006 May 10
7
has_many :through scope on join attribute
Hi I have a has_many :through. It''s a basic mapping of Project id .... User id .... TeamMembers project_id user_id role What I would like to do is have different roles so I can have in the project model has_many :core_members, :through => :team_members, :source => :user but I would like to limit this to only those with the "core" role in the team members table for
2006 May 20
7
Polymorphic, many-to-many, self-referential data model
No matter what I try I''ve been unable to work how to get this to work with the cool ActiveRecord helpers. I''m not sure if it''s possible, Josh Susser''s blog suggests it is, but damned if I can work it out... I have: Container which can contain one or more Element. An Element is a polymorph of either a Container or a Chunk. An Element can exist in one or more
2006 Jul 28
11
Forum
Im making forum and i have problem with paths. Here is code: http://pastie.caboo.se/6389 With this code, it works. But its a bit weird to use so many paths function. For every path i need to make new function. So can you suggest me something. Tables are like here: http://wiki.rubyonrails.com/rails/pages/ForumExample -- Posted via http://www.ruby-forum.com/.
2006 Jul 10
10
has_many :through and foreign key parameters
I just took my HABTM and turned it into a :through since my join table has another "non-joiny" attribute. I went from this: has_many_and_belongs_to :jobs, :join_table => ''tablename'', :foreign_key => ''x'', :association_foreign_key => ''y'' to this: has_many :jobs, :through =>
2006 May 06
3
Storing additional data on join tables with Rails
Hi there I need to store additional attributes on join table. Searching the Wiki [1] revealed two possible methods: 1) push_with_attributes, as described by Justin Palmer [2]. Unfortunately, "this method is now deprecated" [3]. Even if it wasn''t, there seem to be inherent problems with that approach, for example with updating those additional attributes, though Joshua Muheim
2006 May 31
6
habtm on an array (or object.habtm.habtm)
Hi, I have three Models: User, Group and File. User habtm groups and Group habtm Files How can I find all files that a particular user has access to? eg user.groups.files ? As user.groups returns an array, the above doesn''t work. Id like to find the files for all groups in that array, without adding any code to the User model. Thanks in advance PS I just posted this in the
2006 Jul 10
7
What is has_many :through really buying you over HABTM?
So having just learned how to do has_many :through as opposed to HABTM, and then, being concerned that I wouldn''t get it to work, I started thinking about these two approaches. It seems to me that the _only_ problem that the HM:T (has_many :through) approach solves that HABTM doesn''t is the issue of the potential collision of id columns between your join table and one of
2006 Jun 27
3
Trunk or 1.1?
If you were launching a site in late September, would you be developing with Rails 1.1 or on edge rails? Joe
2006 Apr 20
3
has_many :through with has_many/has_many join models
It seems that using a join model that joins with two has_many''s will fail to generate proper SQL class StudentSemesterRecord < ActiveRecord::Base belongs_to :semester has_many :discipline_records, :through => :semester end class Semester < ActiveRecord::Base has_many :student_semester_records has_many :discipline_records end class DisciplineRecord <
2006 Jul 04
2
has_many working correctly only on reload!
I have this code that is using svn externals with rails EDGE working fine for the past couple of months. A couple of days ago, this code died. Even after deleting vendor/rails, this code doesnt work: class Tag < ActiveRecord::Base has_many :taggings has_many :events, :through => :taggings has_many :users, :through => :taggings end class User < ActiveRecord::Base # Virtual
2006 May 16
4
Problems with multiple ''id'' columns in a join_table
I have a problem declaring a relationship through a join_table ; the SQL generated by ActiveRecord is correct, but there are two columns called ''id'', and the final object gets the ''wrong'' column ... Here''s a more detailed description of the data, code, and problem :- There''s a People table, with id, name, and a few things. Also a
2006 Jul 15
2
find() with id array - can i preserve the ordering?
Sort of a newbie question - sorry if it''s been asked before and I missed it in my search. I have an id_array of Author ids, and I want to retrieve the associated Author models as quickly as possible, but also preserve the ordering of the id_array. Using Author.find(id_array) returns the records, but not in the same order. Is there some flag I can pass to find() to preserve the order? I
2006 Jun 29
3
stylesheets
hi, all i have been playing around with rails for sometime, i have seen most not all of the rails sites have similar look and feel (good one) i want to know how to use the stylesheets provided by the RoR framework if any or is it that we have to define on our own from scratch. basiclly i need information regarding how can i make my view better looking(the visuals) Thanks in advance warm
2006 May 05
11
Listing Actions
OK, call me crazy, but am I the first one to want to list out the actions that are available @ runtime? Anyone else come across this yet? Am I crazy? Well, yes, but... -- Posted via http://www.ruby-forum.com/.
2006 Jul 05
7
HABTM join table has an "ID" column - is this an issue?
All, I''m building model objects for existing tables that I cannot modify. In AWDWR, Dave says "Note that our join table has no id column...The second reason for not including an id column in the join table is that AR automatically includes all columns from the join tables when accessing rows using it. If the join table included a column called id, its id would overwrite the id
2006 Mar 29
4
:through alternate
I''d like to use :through to create a web of associations like: class Thing < ActiveRecord::Base has_many :child_things, :through => :thing_thing has_many :parent_things, :through => :thing_thing, :some_other_option? end class ThingThing < ActiveRecord::Base belongs_to :thing belongs_to :child_thing, :class_name => ''Thing'', :foreign_key =>
2006 May 27
7
How should I select rows from a join-model based on more than one association?
A concrete example: We''re building a system to organize the information about workshops being held in various conventions. A convention has more than one workshop, and each workshop can be held in more than one convention. Also each workshop has a host, who is specific to a workshop being held in a specific convention. For example, Matz may host an "Introduction to Ruby"