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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:27:21+00:00 2026-06-05T15:27:21+00:00

I am writing code to clone object but have no cue from Hobo documentation.

  • 0

I am writing code to clone object but have no cue from Hobo documentation.

I know how to do it in Rails but it seems no intuitive way to do it in Hobo.

The scenario is to add an button on a record page, clone an existing record, and redirect to new record after the creation.

For example

POST /papers/10/clone

Then the new record 123 will be created.

After that action, it will redirect to page /papers/123

Are there any examples and guides to achieve the scenario?

If Paper has many Comments, how to clone them as well without permission errors?

  • 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-05T15:27:23+00:00Added an answer on June 5, 2026 at 3:27 pm

    Hobo doesn’t have any special support for cloning an object, so you’ll have to drop down to Rails to do it:

    def clone
      paper = Paper.find(params[:id])
      fail if paper.nil?
      clone = paper.clone
      clone.save!
      redirect_to paper_path(clone)
    end
    

    You could add this new controller action to your routes via Hobo’s web_method hook, but that’s designed for something else. You’re better off just adding it to your config/routes.rb in a standard Rails fashion.

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

Sidebar

Related Questions

I have some file writing code that works as expected, but prints an error
I'm writing code to download email from various servers, some of which are outside
i am writing java desktop application. i have some textareas to get data from
While writing code in a file that would comprise of PHP, HTML, CSS &
While writing code, it is pretty common to request a page with an appended
When writing code in an Eclipse project, I'm usually quite messy and undisciplined in
I am currently writing code in C++ to find all possible permutations of 6
I'm writing code to use UIImagePickerController. Corey previously posted some nice sample code on
I am writing code in Java where I branch off based on whether a
I find myself writing code such as: foreach($array as $key => $value) { switch($key)

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.