similar to: Newbie Question. I''m dumb with forms and foreign keys

Displaying 20 results from an estimated 5000 matches similar to: "Newbie Question. I''m dumb with forms and foreign keys"

2006 Jan 14
11
accessing models from migrations
Ok, so now Users need to be associated with Organizations. I''ve created a migration and added a ''organization_id'' column to the users table. I want the default organization_id to be the first Organization. So I have :default => Organization.find(:first). But it''s complaining about not being able to find the constant ''Organization''. Any
2006 Apr 05
3
"partitioning" table access
Hopefully someone can give me some advice on how to approach this problem... I''m getting ready to start a large new project where several different organizations would be working with a lot of tables. Each table would have an organization_id field to signify which organization owns that record. Organizations would only be able to view/edit records they own. Potentially thousands of
2011 Jul 05
2
Using Capybara to select from a collection_select call (select tag)
I''m trying to use Capybara to test this. I have a step that goes When I select "Price Chopper" from "Organization" And the step definition is When /^(?:|I )select "(.+)" from "(.+)"$/ do |value, field| select(value, :from => field) end For some reason, I keep getting the error: cannot select option, no select box with id,
2006 Jan 09
4
scaffold seems broken on show,edit,delete
After running generate scaffold and pointing the browser, the data list appears correctly, the create new button works okay, but show, edit, delete give the following error: "Could not find Organization without an ID" running on ubuntu breezy with postgresql - data and everything else appears correct - any ideas?
2007 Aug 03
0
acts_as_paranoid and Association Extensions (has_one troubles)
Hi... Isn''t there a proper way or hack/workaround for the following? * For the example with unfortunate disabilities.. look below,,, Usage of has_* (associationmethods) do {def with_deleted AccociatedModel#with_scope} {Paranoid''s#find_with_deleted}... The has_one associations give me a nil object when invoking it with Model.association_OBJECT.with_deleted. Has_many does like
2005 Mar 09
1
Slightly OT - Snom 190 function keys via subscribed config
Hi All, I realise this is off topic, but its likely the best place to ask! I sent an email to snom support a few days ago but have yet to recieve a response.. Perhaps some one has found a solution to this problem already? I've searched the mailing lists and google and found nothing useful. I've also read Snom's mass deployment documentation but thats no real help in this case.
2008 Jun 12
1
How do you reconcile foreign keys for forms?
Hi all, I''m looking to resolve foreign keys for forms -- similar to the way "streamlined" does it. Although the actual value stored in an object is the foreign key integer, I''d like the actual name of the item displayed. I''m *sure* it''s easy. Thoughts? Regards. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2006 Jul 28
3
Forms: handle foreign keys (AssociationTypeMismatch)
Hi all I tried and tried and tried, but I still fail in creating a form with proper validation and stuff for foreign keys... So I''d really like to get some help here. I''m creating a booking site for DJ''s, and for every booking one can choose one of different countries: class Booking < ActiveRecord::Base validates_presence_of :country_id
2006 Nov 16
2
ssh-decrypt
Hi, One of the problems we are facing is secure storage of passwords (database, bestcrypt, other applications/systems, ) and availability within users' scripts (perl, python, ...) or applications (Java, C, ). I'm sure that there are quite a few people who are facing the same issue and there are quite a few home made solutions, such as password obfuscators and/or solutions based on the
2008 Apr 30
4
Beginner mysql problem
I am new to rails and have come across a problem with a sample application I was working on. When trying to use rake migrate I got the error listed below. my db file contains the following class ContactDb < ActiveRecord::Migration def self.up create_table "people" do |t| t.column "id", :integer t.column "name",
2014 Mar 12
1
Documentation SIG
Hey all - Just curious to find out if there's any activity with the documentation SIG? I'd like to join. One thing i've noticed is that it seems like documentation for CentOS ends at 5. While the documentation is more or less mirrored from RedHat's site, this can be confusing to beginners since they may get the impression that documentation isn't there. That being said, i
2009 May 18
3
Please translate M$ speak: create a new organizational unit
Hi All, I am a bit new to Samba PDC. When a M$ tech article says: "Use Active Directory Users and Computers to create a new organizational unit (OU)". What does this mean in Samba PDC talk? Please translate. Many thanks, -T I have a lot of guesses, but I want to hear it from someone who has already done it.
2006 Feb 22
5
Optional Include Relationship
I did some searches in the mailing list and on the web but I can''t seem to find the answer to this, but it''s pretty much a noob question. I have a Product object class Product < ActiveRecord::Base has_many :product_identifications has_one :product_identification_item_number has_one :product_identification_product_code end the product_identifications is using
2005 Nov 28
1
has_one / HABTM relationship overlap - please advise
1. I have a few tables: ''users'', ''shops'', ''addresses'', and ''pictures''. 2. Users and Shops will both use the addresses and pictures tables. I have created several mapping tables: addresses_shops pictures_shops addresses_users pictures_users 3. Users CAN have many addresses and pictures (simple HABTM), but... 4.
2006 Apr 24
4
creating a select box
Hi trying to create a select box in _form.rhtml. I have a table called organisations that contains fileds, 2 being ''id'' and ''name'' these are the fields I need to bring over to the clients _form.rhtml. whats the best way of going about that?? 2 ways i have seen suggested that I cant get to work -@organisations = Organisation.find_all placed this in def new
2011 Feb 26
1
How to manage the form of a model that has two foreign keys
Hi, Basically I have two models: User and Godfather. The godfather table has three columns: - user_id (FK --> User) - user_godfather_id (FK --> User) - description (text) Inside each model class, I am adding the following associations: class User < ActiveRecord::Base has_many :godfathers # for user_id has_many :godfathers, :foreign_key =>
2005 Dec 27
3
What is the best way of setting up the following model:
Hi, I am new to Rails (and Ruby) and for what i have seen sofar i like it a lot! But i can''t figure out what the best sollution would be for the following: Lets say i want to setup a CRM system and i have to sorts of contacts: Customers and Prospects. A part of the info is the same (addresses, company info etc) for both customers an prospects and a part is different. What i would
2006 Aug 27
3
n-to-m relationships in Forms
Hi, I can''t understand the RoR-API concerning certain form helpers. Can you maybe help me? I have a model, Film, with a habtm-relationship to the model Language. Now if I want to have a form for editing/creating a Film, I''d like to have checkboxes for each Language with those checked that are associated with the Film in question. Is there an "easy" way to do this
2006 Feb 23
5
sortable_list added to by AJAX question
I have a working sortable_list that is added to by AJAX. The problem is that when a new item is added, it''s not sortable. I found a post on scriptaculous using behaviour.js to refresh the DOM when an item is added, but I can''t figure out how to do it with Rails. To test the behaviour method, I used this: var myrules={ ''div#steps ul'' :
2006 Mar 28
2
Fastest way of adding " " around multiline text in RADRAILS
lets say i have the following SQL in my database editor : When i paste it into rad rails i have to add quotes and the ''+'' symbol to the end of each line. It is very tedious. What is the best method? select timesheets.employee, sum(items.hours) as hours, sum(items.hours*timesheets.cost) as cost, sum(items.hours*timesheets.charge*decode(activities.chargetype,0,1,0)) as charge,