rubyonrailsin

A Ruby and Rails talk

Tuesday, March 9, 2010


[Rails] Re: RESTful photo album

by rubyonrailsin 0 comments



Share this post:
Design Float
StumbleUpon
Reddit

DmitryPush wrote:
> Hi, all!
> I'm new in Rails.
> I've read "Agile web development" and now I want made my very first
> rails application - photo album.
> But I don't know how to design it RESTful.
>
> For example I have 3 chapters and 100 photos on each one and i want
> list only 10 photos on page.

Forget about trying to engineer your URLs (save that for later if you
want).
Take a look at mislav-will_paginate for showing N items per page. Mix
that with good use of the in_groups_of, and you can have a nice layout
in rows and columns if that's your desire.


> And now I also want know in general how to process request like
> site.my/say/hello/to/homer
> I know if it just site.my/say/hello - then 'say' - it's controller
> and' hello' - it's action, but what when 'to' and 'homer'?
> How exactly tell my rails application whet I want say hello to Homer?
>

You'll want to read up on specifying routes in rails to accomplish that
task.
--
Posted via http://www.ruby-forum.com/.

--
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.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive