Ruby on Rails Wednesday, August 7, 2013

On Tue, Aug 6, 2013 at 7:59 AM, <ashwinmertes@telenet.be> wrote:

> If a user is logged in, he can see the jobs he created at
> /users/:user_id/jobs. If a user is not logged in, he can see
> all the jobs created by all users at /jobs.

I would recommend un-nesting them. IMHO, nested resources only make
much sense when the inner ones don't make sense outside the context of
the outer ones. (Alternate viewpoints welcome!) Since you allow
/jobs, that's clearly not the case.

Anyway, then you can make the "my jobs" URL something like
"/jobs?posted_by=123" or even "/jobs?posted_by=me" (and interpret "me"
in the controller). That could even be one of many possible job
filtering params.

-Dave

--
Dave Aronson, the T. Rex of Codosaurus LLC,
secret-cleared freelance software developer
taking contracts in or near NoVa or remote.
See information at http://www.Codosaur.us/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQigx8uKon6j%2BqicEij8i5ny9VjosRwt_g4BM1ErxJa000g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment