Re: find() performance

Anton Aylward
Mon, 05 Feb 2007 21:27:22 -0000

On 12/17/06, *Chad Arimura*
<carimura-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>
>     If so, 2) is there a better way to handle the find in a more
>     efficient way
>     and still use the string name in the URL''s?

Take a look at Tressle
http://trestle.rubyforge.org/
and
http://www.rubyinside.com/trestles-replacing-rails-scaffolding-with-something-better-138.html

/people  	  	Lists existing person records
/people/new 	GET  	Shows an empty person form
                POST  	Creates a new person record from request parameters
/people/99 	 	Shows the person record having ID 99
/people/99/edit GET  	Shows a person form for the record having ID 99
		POST  	Updates the person record having ID 99 using request
                        parameters
/people/99/destroy 	GET  	Redirects to /people/99/edit with a notice
                                that the user must click the form’s Destroy

                                button in order to destroy a record
			POST  	Deletes the person record having ID 99 after
                                prompting the user for confirmation


Personally I hate the verb-object form and I hate the :id as an absolute.
We see in wikis and blogs the use of a name parameter

	/people/jack

There are many settings where you don''t want the user/hacker to step
through
the numbers.

I''m a user of TWiki as a wiki and I find the
"http://twiki.org/cgi-bin/view/web/topic"
annoying.  The "cgi-bin/view" is not needed, and as Nils
Jonsson''s article
points out, the move from view to edit is easier if the verb is a suffix.

One day I''ll figure out the mapping for

      /web/topic	/web/topic/edit
      /web.topic	/web.topic/edit
      /web.topic?edit
      /web.topic?edit&skin=cosmos
      /web/topic?raw=on

and so forth


--
We know nothing about motivation. All we can do is write books about it.
   --Peter F. Drucker

--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com