I did start to go down the named routes path. What mystifies me is
that I tried generating scaffolding on linux.
If the scaffolding is generated on linux it seems to work fine, but
if it's generated on windows and copied to linux,
it doesn't work quite right, even though it all appears to look the
same. What I don't get at all is the scaffolding creates
named routes, but I don't see where they are created. That's basically
where the problem is. So I went and
added some routes by hand in routes.rb for one of my controllers like
this:
map.criteria 'criterias',
:controller => "criterias",
:action => "index"
map.criteria 'criteria/edit/:id',
:controller => "criterias",
:action => "edit"
map.criteria 'criteria/show/:id',
:controller => "criterias",
:action => "show"
Now I changed my scafolding to look like this for show and edit:
<td><%= link_to 'Show', show_criteria_path(criteria) %></td>
<td><%= link_to 'Edit', edit_criteria_path(criteria) %></td>
Show works fine, but when I click on an edit, it appears that my
controllers edit method gets called and
then it calls render the template. That works fine, I have log
messages in the template. The very last line of the template is a log
message that shows up in the log ("inside template 4") bellow. The log
file
indicates a 200 status, but the browser gets a 500 status
Parameters: {"action"=>"edit", "id"=>"7", "controller"=>"criterias"}
#<Criteria id: 7, title: "test", description: "", salary: "",
work_type: "", location: "", zip_code: "", created_at: "2008-07-16
08:26:57", updated_at: "2008-07-16 08:26:57">
Rendering template within layouts/main
Rendering criterias/edit
inside template#<Criteria id: 7, title: "test", description: "",
salary: "", work_type: "", location: "", zip_code: "", created_at:
"2008-07-16 08:26:57", updated_at: "2008-07-16 08:26:57">
inside template 1
inside template 2
inside template 3
inside template 4
Completed in 0.06958 (14 reqs/sec) | Rendering: 0.01398 (20%) | DB:
0.00000 (0%) | 200 OK [http://itjobs.freespiritboston.net/criteria/
edit/7]