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 7070195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:32:14+00:00 2026-05-28T05:32:14+00:00

Given two resources http://example.com/places/1 http://example.com/places/2 How should the endpoint look like to merge both

  • 0

Given two resources

  • http://example.com/places/1
  • http://example.com/places/2

How should the endpoint look like to merge both resources into a single resource? Ideally after the merge only 1 resource will remain.

At first glance I could do a PUT to http://example.com/places/1 with params[:src_id] = 2. Which would merge the attributes from the second resource into the first and delete the the second resource. Does anyone else have a better approach?

Note that I’m using Rails which doesn’t support the http MERGE verb so that’s out of the question.

  • 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-28T05:32:15+00:00Added an answer on May 28, 2026 at 5:32 am

    I suggest a new controller PlacesMergeController with a new and create action. In the new action, you would have a form asking which places to merge. The form will do a POST request to the create action, where you do the actual merging. Depending on the complexity of the logic you could also have a PlacesMerge model (non-AR!).

    This approach should give you maximum flexibility in terms of handling source/target of the merge operation – and it’s easily maintainable.

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

Sidebar

Related Questions

The sample code for a basic web server given by http://twistedmatrix.com/trac/ seems to increment
Given two integers a and b , how would I go about calculating the
Given two sets A and B, what is the common algorithm used to find
Given two 3D vectors A and B, I need to derive a rotation matrix
Given two colors and n steps, how can one calculate n colors including the
Given two interface references obtained from different sources. Is there a programmatic way to
Given two date ranges, what is the simplest or most efficient way to determine
Given two shorts ( System.Int16 ) short left = short.MaxValue; short right = 1;
Given two sets of values: var subset = new[] { 2, 4, 6, 8
Given two tables, one for workers and one for tasks completed by workers, CREATE

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.