search for: djurner

Displaying 7 results from an estimated 7 matches for "djurner".

2006 Jan 17
9
using "find" when you have 2 has_many relations
An Account has_many Websites which in turn has_many WebsiteDomains Now I can of course do this: @domains = Account.find(1).websites.find(1).website_domains.find(:all) To get all the domains for Account with id 1 and Website with id 1. I would like to do something like this though: @domains = Account.find(1).websites.find(:all).website_domains.find(:all) IE, get ALL domains for all websites in
2005 Dec 28
3
Storing static info in table or model?
Hi, what are your thoughts on where and how to store static information like for example a countries list? I can''t decide whether I should store it as a table called Countries in the database or just create a non active record model that just lists the countries in a hard-coded array in the model file. Is one better than the other? -- Posted via http://www.ruby-forum.com/.
2006 Jan 17
3
DHTML Drop Menu Helpers with Rails?
Does RoR ship with, or have any add-in helpers used to construct a "drop menu" typically done with DHTML trickery and some libraries? I am referring to menus like the "File Edit View ... Help" menus with cascading drop-down navigation that you find at the top of most GUI applications. Allen
2006 Jan 20
4
Prepending table names on a per user or sub domain basis
Here is a sample of the database structure I want to have: someclientname-websites someclientname-canned_responses someclientname-canned_responses_websites anotherclientname-websites anotherclientname-canned_responses anotherclientname-canned_responses_websites As you can see I want to prepend the name of my future clients to the table name so that they use completely different sets of data. I
2006 Jan 17
30
MVC design good/bad
I am curious what you find is good and bad MVC design. Let''s use the find and find_by_sql methods as examples. Currently I have these spread out all over the place... View: here I have some find methods when I am for example populating a select list with choices in a form. Controller: here I have the simpler find methods. Model: here I have the more complicated find methods (usually
2006 Jan 19
1
Using same form for two models
Hi, this is probably easy but I can''t find any good examples of it. I have 2 classes, Person and EmailAddress (one person has many email_addresses). How can I create a form on which you can add one person and multiple email addresses to the database? I want to avoid creating two forms. Preferably it should also do validation so that a person always has at least one email address.
2005 Nov 22
3
non model select_tag problem
What am I doing wrong here: select_tag(''website_ids[]'', options_from_collection_for_select(Website.find_all, ''id'', ''name'', params[:website_ids]), {:multiple => true, :size => 5}) It works fine except that it does not display the selected options once the form is submitted (it submits to the same page). The