Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5959855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:44:36+00:00 2026-05-22T18:44:36+00:00

In the process of making an ebook, users have to edit its content, edit

  • 0

In the process of making an ebook, users have to edit its content, edit its metadata, choose marketing options, (such as pricing and distribution) and publish.

I started to put each everything inside the Book resource (contents, metadata, marketing options etc)

Then each step of the process (contents, metadata, marketing) is an action inside BooksController.

But Books started to grow a lot in terms of attributes and actions.

I’m wondering if it is better to force RESTfulness by creating singleton resources, each associated to their respective book.

The routes would be:

  • /book/12/content/edit
  • /book/12/metadata/edit
  • /book/12/marketing/edit

This seems more elegant, as each of these “resources” are RESTful and have few attributes each. But the resources are not objects (Marketings?).

Do you thing it’s OK to create meaningless resources just to be RESTful and keep code in order?

Is there a better way to group similar attributes than create resources out of them? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:44:37+00:00Added an answer on May 22, 2026 at 6:44 pm

    I’m porting a large PHP application to Rails and we have a fair few “ad-hoc”resources, such as admins have the ability to log in as another user with their permission, in order to correct issues etc. I would always complain that features such as logging in as other users should not be bundled into a huge monolithic AdminController as actions loginAsUser and logOutOfUserAccount. In our Rails app we try to visualize as much as we can in terms of resources, so using the example I just gave, we have an Admin namespace, under which there is a UsersController (/admin/users/:id) and as a sub-resource of users, we have a UserOverride resource (/admin/users/:user_id/override)… it feels really logical that we just POST and DELETE to this resource.

    So getting back to your example, yes, I think you should break those sections down into separate resources. It certainly seems like BookContent should be a sub-resource of Book, and MarketingOptions too.

    resources :books do
      resource :content
      resources :marketing_options
    end
    

    etc

    This is both nicer to work with (more modular) and easier to visualize just from looking at the routes alone. You also get the benefit of really predictable path helpers:

    <%= link_to("Marketing Options", book_marketing_options_path(@book)) %>
    

    You can’t try to force every conceivable route into a RESTful resource ideology though… if it feels like it’s forced, then it probably is.

    There’s a decent blog post I wanted to link to that (despite some poor grammar) actually does a pretty good job of showing you how to think about your application in terms of resources… I can’t find it though. I’ll add a comment if/when I do.

    EDIT | Just re-reading your original question and wanted to clarify: resource != row in database. A resource is anything you can conceive as a “thing”… I know that’s a very broad statement, but just like an Object in OOP doesn’t have to represent something concrete/material, nor does a resource in a RESTful design.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a really really small linux distribution or process of making my
I'm in the process of making my PHP site Unicode-aware. I'm wondering if anyone
I am currently in the process of making a new ASP.net MVC website, and
I am just in the process of making some little demo tutorial videos for
I have 1 process that receives incoming connection from port 1000 in 1 linux
Java process control is notoriously bad - primarily due to inadequate support by the
There is a conversion process that is needed when migrating Visual Studio 2005 web
I'm in the process of refactoring some code which includes moving folders around, and
A Windows process created from an exe file has access to the command string
I'm in the process of weeding out all hardcoded values in a Java library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.