similar to: Automatically mapping content_columns?

Displaying 20 results from an estimated 20000 matches similar to: "Automatically mapping content_columns?"

2006 Mar 18
3
Nil result on find & pretty print
I am new to Ruby and to Ruby on Rails and have spent the last few days trying to get my head around it. I think I am already hooked but am suffering badly from years of programming a non-OO RDBMS. I am trying to learn by attempting to produce a system for my work. I have a main table sdocs which has a field supplier_id which is an entry in another table (suppliers) to lookup supplier name etc.
2006 Feb 03
1
Only iterating over the middle content_columns?
Standard behavior for the list action is to use content_columns to get all the fields of a model and then do something with them. I''d like to ignore some of them and iteratre over the rest. For instance I may have A B C D ... X Y Z and I''d like to do something special with A and B and then Y and Z, but in the middle I''d definitely like a loop to say
2006 Mar 03
0
Does content_columns hold related data from other tables?
I''ve got a belongs_to / has_many relationship working, however I don''t know if I can still use content_columns (or any other shortcut) in my view that displays my object. E.g., Employee belongs_to Department I''m displaying an Employee. Will content_columns contain employee.department.name? Or how else could I do this so I don''t have to hard-code column
2006 Mar 22
3
Something wrong with content_columns
I have a database with a couple of tables. One table called spares has foreign keys in another called equipment. When I create a new record, it is added to the spares table however the list action does not show all the columns in the table. It only shows those columns that are not foreign keys. I am using the default action generated by scaffold for list. Why is that so? Do i need to re-write my
2005 Dec 30
3
Too many columns for list.rhtml to display on one page
I''ve gone once through the Agile book and am now attempting my own rails app. I''ve created a table named ''volunteers'' with over 15 columns. The problem is the default list.rhtml that is created with the scaffold, shows all the columns. I only want to show 4 of them with the list view. Where would I start to only return a handfull of columns to the
2005 Dec 27
3
myObject.send(column.name) from Agile Development book
I''m studying the Agile Development with Rails book. In the chapter that first sets up the depot application (page 68), there is this bit of code from a view: <% for product in @products %> <tr> <% for column in Product.content_columns %> <td><%=h product.send(column.name) %></td> <% end %> etc... I am trying to absorb both Ruby and
2006 Mar 23
3
when (not) to use belongs_to
I know you get a lot of questions like this, but I couldn''t find one which answers exactly what I''m after. I''m reasonably new to rails, and I''m having a bit of trouble with when to use belongs_to. On the rails wiki ( http://wiki.rubyonrails.org/rails/pages/belongs_to), it says "In general, the Foo model belongs_to :bar if the foo table has a bar_id foreign
2006 Mar 22
2
Radio Button Defailt Value?
I have: <%= radio_button ''foo'', ''bar_id'', ''1'' %> <%= radio_button ''foo'', ''bar_id'', ''2'' %> <%= radio_button ''foo'', ''bar_id'', ''3'' %> I would like to have option #3 be selected if foo.bar_id is nil. Is there a way to do
2008 Jun 10
7
Unraveling a FAR*
Hi all, Just looking over fole_s_connect() in win32ole.c and I noticed this bit: hr = CLSIDFromProgID(pBuf, &clsid); ... hr = GetActiveObject(&clsid, 0, &pUnknown); ... hr = pUnknown->lpVtbl->QueryInterface( pUnknown, &IID_IDispatch, (void **)&pDispatch ); Using win32-api, that would be something like: IID_IUnknown =
2007 Mar 14
0
#content_column and polymorphic columns
Hi ! I'm need to use ActiveRecord::Base#content_columns, but this method does not filter out columns suffixed with _type, which is what polymorphism uses. I checked the 1.2 branch and trunk, and both don't do it: http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/base.rb#L810 Is that considered a bug ? I'll whip up a test and patch if that is indeed a bug. Bye
2004 Jan 15
1
Mapping a drive letter to a Samba share
Hey guys, I'm in kind of a crunch right now. Due to a poorly written script that I don't have control over, I need to be able to map a drive letter to a Samba share so that it works seamlessly with UNC (i.e \\server\Share <file:///\\server\Share> ). Basically, I need a way for a share name with a $ in it to be recognized as a valid network name. My current setup is like so:
2006 Apr 27
2
"for column in..." not picking up _id columns
My code executes fully: <% for column in ModelName.content_columns %> <th><%= column.human_name %></th> <% end %> but it does not pick up any columns in my model''s table that end in "_id". Is this by design? Is there a helper method that will reference the related tables? Or will I need to code the column titles and detail records by
2006 Jul 21
3
Migration and Mysql row ID
Apologies if this has been discussed before, but with the search function down its hard to find out if it has The first Agile book recommended using the automatically assigned row id of an object as a foreign key reference, as rails would automatically interpret the attribute (for example) product_id as the table ''product'' and row ''id''. I''ve just
2005 Oct 12
1
[ win32utils-Support Requests-2614 ] warning: redefining constant Struct::Win32ServiceStatus
Support Requests item #2614, was opened at 2005-10-12 10:23 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=2614&group_id=85 Category: win32-service Group: None Status: Open Resolution: None Priority: 3 Submitted By: Scott Harper (sharperct) Assigned to: Nobody (None) Summary: warning: redefining constant Struct::Win32ServiceStatus Initial
2006 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables CREATE TABLE continents ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE countries ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, continent_id int(11) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; I generate scaffolds for country and for
2005 Dec 31
7
Dynamic form? Not really!
Hi guru''s out there, Im happilly coding my first rails app, and all goes well. I find myself manually coding in a particular field all the time (company_id), that relates the contact to a company. The total coding of this form seems somewhat much. Could somebody tell me what Rails power I''m possibly missing and stuborn as I am trying to do myself? I was wondering if the
2009 Mar 16
1
ANI with Pickup application
Hi, does anyone of you have made it to get the ANI also picked up? I mean: if I fetch a foreign call to me by using the pickup application I want to see the callerID/ANI of the caller to the foreign extension. Is that possible and if yes - how do I achieve that? Regards, Christophorus
2006 Jun 24
2
Migrations problem with Agile Rails book
I am following the instructions on Agile Web Development with Rails book "Iteratio E1: Capturing an Order" section. When I run the migrations I get the following error. rake db:migrate (in /Users/balaparanj/work/depot) -- execute("alter table line_items \n add constraint fk_line_item_products \n foreign key (product_id) references products(id)") rake
2006 Oct 31
4
Auto-increment lost during migration.
Hi. I get some strange results when using rename_column on a primary key in a migration. It seems like the migration script removes the auto-increment property if you rename a column. This is a minimal example. create_table :foo, :primary_key => :foo_id do |t| t.column "name", :string end # renaming the primary key makes auto-increment disappear. rename_column
2006 Feb 03
1
Database Foreign Key - Basic question
Hi all I''m still waiting on my Agile Rails book to arrive - in the meantime ... As an exercise I''m making a Help Desk application. If I have a Problems table with two foreign keys to a People table, how do I set up my models, problems_controller list method, and then simply display say my problem submitter person? Here is what I have so far: Problems table with columns: id