displaying the id field

When the browser is pointed to <http://localhost:3000/feeds&gt; there's a CRUD interface. However, the interface doesn't display all of the fields defined at <http://strawr.googlecode.com/svn/trunk/db/ migrate/001_feeds.rb>.

I've done "rake db:migrate VERSION=0 ; rake db:migrate" and, also:

thufir@arrakis ~/Desktop/strawr/db $ thufir@arrakis ~/Desktop/strawr/db $ ll total 20 -rw-r--r-- 1 thufir users 9216 Dec 8 04:29 development.sqlite3 drwxr-xr-x 3 thufir users 4096 Dec 8 04:29 migrate -rw-r--r-- 1 thufir users 1430 Dec 8 04:29 schema.rb thufir@arrakis ~/Desktop/strawr/db $ thufir@arrakis ~/Desktop/strawr/db $ sqlite3 development.sqlite3 SQLite version 3.4.1 Enter ".help" for instructions

.schema

CREATE TABLE categories ("id" INTEGER PRIMARY KEY NOT NULL, "parent_num" integer DEFAULT NULL, "title" varchar(255) DEFAULT NULL, "feed_id" integer DEFAULT NULL); CREATE TABLE feeds ("id" INTEGER PRIMARY KEY NOT NULL, "title" varchar (255) DEFAULT NULL, "location" varchar(255) DEFAULT NULL, "category_id" integer DEFAULT NULL, "item_id" integer DEFAULT NULL); CREATE TABLE items ("id" INTEGER PRIMARY KEY NOT NULL, "title" varchar (255) DEFAULT NULL, "is_read" integer DEFAULT NULL, "link" varchar(255) DEFAULT NULL, "pub_date" varchar(255) DEFAULT NULL, "description" varchar (255) DEFAULT NULL, "feed_id" integer DEFAULT NULL); CREATE TABLE nodes ("id" INTEGER PRIMARY KEY NOT NULL, "obj_num" integer DEFAULT NULL, "norder" varchar(255) DEFAULT NULL, "type" varchar(255) DEFAULT NULL); CREATE TABLE posts ("id" INTEGER PRIMARY KEY NOT NULL, "post" varchar (255) DEFAULT NULL); CREATE TABLE schema_info (version integer);

.quit

thufir@arrakis ~/Desktop/strawr/db $ thufir@arrakis ~/Desktop/strawr/db $

Clearly the "feeds" table has "item_id" as a field; so why doesn't it show in the CRUD? Perhaps I need to undo and then redo the scaffolding?

based on <http://strawr.googlecode.com/svn/trunk/app/views/feeds/ show.rhtml>, I don't see why all the fields for "feeds" aren't being displayed :frowning:

thanks,

Thufir

When the browser is pointed to <http://localhost:3000/feeds&gt; there's a CRUD interface. However, the interface doesn't display all of the fields defined at <http://strawr.googlecode.com/svn/trunk/db/ migrate/001_feeds.rb>.

Scaffolding just iterates over content_columns. If you look a the doc for content_columns you'll see that it doesn't include columns ending in _id

Fred

Yes, you're absolutely correct (I even looked at the API after posting this last night). I tried a few variations, and did some light googling, but didn't find a way to get it iterate over all fields.

Can I just change that one line so that it shows all of the fields when doing any of the CRUD actions?

thanks,

Thufir

Scaffolding just iterates over content_columns. If you look a the doc for content_columns you'll see that it doesn't include columns
ending in _id

Yes, you're absolutely correct (I even looked at the API after posting this last night). I tried a few variations, and did some light
googling, but didn't find a way to get it iterate over all fields.

Can I just change that one line so that it shows all of the fields
when doing any of the CRUD actions?

does using Model.columns do what you want?

Fred

does using Model.columns do what you want?

I still get the same result after using Feed.columns :frowning:

http://strawr.googlecode.com/svn/trunk/app/views/feeds/list.rhtml

The database appears fine:

thufir@arrakis ~/Desktop/strawr/db $ thufir@arrakis ~/Desktop/strawr/db $ thufir@arrakis ~/Desktop/strawr/db $ thufir@arrakis ~/Desktop/strawr/db $ sqlite3 development.sqlite3 SQLite version 3.4.1 Enter ".help" for instructions

.schema

CREATE TABLE categories ("id" INTEGER PRIMARY KEY NOT NULL, "parent_num" integer DEFAULT NULL, "title" varchar(255) DEFAULT NULL, "feed_id" integer DEFAULT NULL); CREATE TABLE feeds ("id" INTEGER PRIMARY KEY NOT NULL, "title" varchar (255) DEFAULT NULL, "location" varchar(255) DEFAULT NULL, "category_id" integer DEFAULT NULL, "item_id" integer DEFAULT NULL); CREATE TABLE items ("id" INTEGER PRIMARY KEY NOT NULL, "title" varchar (255) DEFAULT NULL, "is_read" integer DEFAULT NULL, "link" varchar(255) DEFAULT NULL, "pub_date" varchar(255) DEFAULT NULL, "description" varchar (255) DEFAULT NULL, "feed_id" integer DEFAULT NULL); CREATE TABLE nodes ("id" INTEGER PRIMARY KEY NOT NULL, "obj_num" integer DEFAULT NULL, "norder" varchar(255) DEFAULT NULL, "type" varchar(255) DEFAULT NULL); CREATE TABLE posts ("id" INTEGER PRIMARY KEY NOT NULL, "post" varchar (255) DEFAULT NULL); CREATE TABLE schema_info (version integer);

      .quit

thufir@arrakis ~/Desktop/strawr/db $

-Thufir

does using Model.columns do what you want?

I still get the same result after using Feed.columns :frowning:

http://strawr.googlecode.com/svn/trunk/app/views/feeds/list.rhtml

Well you've still got a content_columns at the top of your page. Other
than that I don't see why it wouldn't work (although you wouldn't see
anything if the _id columns were null)

Fred

Doh, fixed that; thanks. The item_id field for a row in the feeds table will be null until I can edit that field; for instance, by displaying the field.

Won't it show: "item_id: NULL" as it does for other fields?

thanks,

Thufir

Well you've still got a content_columns at the top of your page.
Other than that I don't see why it wouldn't work (although you wouldn't see anything if the _id columns were null)

Doh, fixed that; thanks. The item_id field for a row in the feeds
table will be null until I can edit that field; for instance, by
displaying the field.

Won't it show: "item_id: NULL" as it does for other fields?

no. It would show nil.to_s (ie blank), although you should of course
get the column headings.

Fred