Hi, guys

I have just added a new functionality and attribute to my app.

Basically the main resource, 'part' has been linked with category and
sub category objects.

When creating a new 'part' object, the entry form now has two drop
down boxes, category and sub category.

I put in all the required attributes and hit "Save".

'parts/create' is then run (parts controller's 'create' method).
Based on my controller code, after the object has been successfully
added into the database, a redirection is to be
made to the index page of the 'parts' resource (ie. '/parts').

Here's how the log looks like.

----- extract starts ---------------------------

Started POST "/parts" for at 2012-01-09 21:53:27 +1100
Processing by PartsController#create as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"9P8ga/
n38K58buSAIqTh4XeZ8f3lVYBrjUEx4n7L5is=", "part"=>{"category_id"=>"2",
"sub_category_id"=>"11", "title"=>"s2000",
"description"=>"dmkdmldml"}, "commit"=>"Create Part"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id"
= 2 LIMIT 1
SQL (10.4ms) INSERT INTO "parts" ("brand_id", "category_id",
"created_at", "created_by", "description", "sub_category_id", "title",
"updated_at", "updated_by") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
[["brand_id", nil], ["category_id", 2], ["created_at", Mon, 09 Jan
2012 10:53:27 UTC +00:00], ["created_by", 2], ["description",
"dmkdmldml"], ["sub_category_id", 11], ["title", "s2000"],
["updated_at", Mon, 09 Jan 2012 10:53:27 UTC +00:00], ["updated_by",
Redirected to http://localhost:3000/parts
Completed 302 Found in 83ms

Started GET "/parts" for at 2012-01-09 21:53:27 +1100
Processing by PartsController#index as HTML
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id"
= 2 LIMIT 1
Part Load (0.1ms) SELECT "parts".* FROM "parts"
Rendered parts/index.html.erb within layouts/application (69.3ms)
Completed 200 OK in 138ms (Views: 72.5ms | ActiveRecord: 2.6ms)

----- extract ends ----------------------------

The weird thing here is that whilst "/parts" is accessed as soon as
the insertion is successful and all parts objects are retrieved,
in my web interface, the entry form still persists.

What could be wrong?
what should I be checking?

Thank you

Gordon :)

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
grouprubyonrails-talk @
postedJan 9, '12 at 11:01a
activeJan 10, '12 at 9:04a

1 user in discussion

K.M.: 3 posts



site design / logo © 2021 Grokbase