Pagination Creates New Record

0 views
Skip to first unread message

hraynaud

unread,
Dec 2, 2008, 1:34:46 PM12/2/08
to Streamlined
Hi I recently started using Streamlined by and large it really works
as advertised which is good. Unfortunately I've been having a bizarre
issue with the pagination mechanism in the list view. Whenever I try
to go next page of records
Streamilined automatically creates a new empty record for the model
and attempts to save it. This causes the validations to get triggered
all of which of course fail.

Anyone have any idea might be going on here?

I realize it must be something with my app setup since I can run the
streamlined sports sample without seeing the aberrant behavior.
However, every other aspect of my application is working 100% as
designed and as I expect it to so I don't know where to look.

Your assistance is greatly appreciated.


Bonefish

unread,
Dec 2, 2008, 1:53:55 PM12/2/08
to Streamlined
Please check your Rails log right after clicking the "Next Page"
button and post any error messages you see here. It's hard to tell
what's going wrong without an error message and the associated stack
trace.

Also post your controller code.

Regards,
Kerry

hraynaud

unread,
Dec 2, 2008, 11:51:18 PM12/2/08
to Streamlined
Hi there were no errors getting posted to the log but your suggestion
paid off anyway. Upon closer study of the log It became obvious what
was happening.
I was using name-spaced restful routes for my admin controllers e.g.

map.namespace :admin do |admin|
admin.resources :tutor_rates
admin.resources :subjects
admin.resources :roles
admin.resources :students
...
end
I guess its not supported 100% with streamlined? Somehow clicking
next page was gettng interpreted and a
as restful POST request on the "admin/users" controller which triggers
the "create" action.

I ended up removing the namespaced admin routes as they are not even
necessary in the first place.

Still I'd like to understand whether I actually did something wrong
or namespaced routes are just not fully supported

Bonefish

unread,
Dec 3, 2008, 2:46:49 AM12/3/08
to Streamlined
Per a prior post from Matthew Bass

"RESTful routes aren't officially supported in Streamlined yet, nested
or otherwise. Your mileage may vary."

Regards,
Kerry
Reply all
Reply to author
Forward
0 new messages