Thufir
December 8, 2007, 1:43pm
1
When the browser is pointed to http://localhost:3000/feeds 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
sqlite> .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);
sqlite>
sqlite> .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
thanks,
Thufir
Thufir
December 8, 2007, 2:09pm
2
On 8 Dec 2007, at 12:41, Thufir wrote:
When the browser is pointed to http://localhost:3000/feeds 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
Thufir
December 8, 2007, 8:34pm
3
On Sat, 08 Dec 2007 13:09:05 +0000, Frederick C. wrote:
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?
thanks,
Thufir
Thufir
December 8, 2007, 8:57pm
4
On 8 Dec 2007, at 19:33, Thufir wrote:
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
Thufir
December 9, 2007, 8:03am
5
On Sat, 08 Dec 2007 19:57:04 +0000, Frederick C. wrote:
does using Model.columns do what you want?
I still get the same result after using Feed.columns
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
sqlite> .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);
sqlite>
sqlite> .quit
thufir@arrakis ~/Desktop/strawr/db $
-Thufir
Thufir
December 10, 2007, 10:42am
6
On Sun, 09 Dec 2007 11:04:01 +0000, Frederick C. wrote:
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?
thanks,
Thufir
Thufir
December 9, 2007, 12:04pm
7
On 9 Dec 2007, at 07:02, Thufir wrote:
On Sat, 08 Dec 2007 19:57:04 +0000, Frederick C. wrote:
does using Model.columns do what you want?
I still get the same result after using Feed.columns
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
Thufir
December 10, 2007, 10:51am
8
On 10 Dec 2007, at 09:36, Thufir wrote:
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