José Mota — Web engineer & architect

Singular resourcing on Rails 3 beta

July 6th, 2010

Today I’ve been struggling on my project to be. I want to build it just right so I can learn Rails 3 the best way and enjoy the Ruby and Rails experience a little more. I love their ways, but sometimes it gets tough to go around the normal skeleton of an application.

Singular resourcing was harder to grasp than I thought

The idea is actually pretty simple to understand: for example, you say you want a user to access only one resume because that’s the only one he would have. The scaffold generator adjusts the routing accordingly; well, at least it should.

It should actually be resume_path in the singular but for the URL’s to work you must have an :as parameter in the routes:

I got frustrated for realizing I had to do extra effort to understand something that should have been linear. I need to work around on this. I was thinking of normal resourcing the posts so it could be searchable later on and everything. But it doesn’t feel right, that’s not the business model. A user has its own resume, period. If he is to look at another one, then a custom route will be made up.

I’m asking for help now. If you have something to share regarding this matter, it would be absolutely great and I thank you very much.

PS: Yes, the application started from this point. I have no users yet, no static content, no nothing. Perhaps starting an application with a singleton scaffold was a bad idea. Perhaps start with the users first? After all, they are the system and the resume should belong to them.

No one shared an insight yet.

Leave a comment!