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

  • SEARCH
  • Home
  • 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 8228745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:33:54+00:00 2026-06-07T16:33:54+00:00

I’ve been working on a site but can’t seem to come up with a

  • 0

I’ve been working on a site but can’t seem to come up with a good design for its implementation. Here’s the flow:

user selects a shirt. User selects what size of shirt. User says what they want on it, and it is added to their cart. They can repeat or go to checkout.

the problem i’m having is for a line_item to be added to the cart, it needs a sku and a design record. The design record gets created at the point where they add it to their cart.

Right now, I have everything in a store_controller.

So I have methods like prepare_for_cart, add_shirt_to_cart, confirm_order, add_design, show_receipt… I don’t know how I could possibly break this stuff up into something restful.

So is it something that can always be worked out with REST, or are there truly some cases where it doesn’t work? What’s one to do to try and make this more maintainable and understandable? are there other applicable design patterns to consider?

  • 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-06-07T16:33:56+00:00Added an answer on June 7, 2026 at 4:33 pm

    In almost all cases REST is a possibility, but it’s not always the best possible choice.
    If for instance you have an endpoint that should send out an email, you could create unique urls for these:

    POST emails/  (which creates)
    GET emails/12345
    

    Similarly with your design, it would be possible to have urls like:

    cart/1234 (GET for the current cart contents, POST to add a new product to the cart)
    cart/12345/shirt (1 specific item in the cart, which can be deleted)
    

    One thing that may help you think about this, is to stop thinking about urls and most importantly methods. only think about the documents you’re sending back and forward. The ‘RE’ in REST stands for representation, the GET, PUT, DELETE methods are just simple means to transfer the representation from client to server.

    Edit

    Well, REST is a very nice design. It’s not designed to be easy to implement, or even consume.. but it’s designed for robustness, something that can last 10 years and remain backwards compatible. Just like the web itself.

    This investment may not be worth it for you, you may simply want to use an approach that’s easier to implement. Sure, you won’t be REST-compliant™. It’s just not for everyone, it takes one look at how the average api from any big vendor works, to realize many have decided to not apply a RESTful design.

    So figure out the pro’s and cons for yourself; technical merit is the only thing that counts in the end.

    The fact that you have to ask ‘how do I make this RESTful’ tells me you need to do more research first, and figure the what and why of REST in general.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.