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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:32:29+00:00 2026-05-23T02:32:29+00:00

This is the etherPad workflow: load http://ietherpad.com click ‘new pad’ which takes you here:

  • 0

This is the etherPad workflow:

load http://ietherpad.com
click 'new pad' which takes you here: http://ietherpad.com/ep/pad/newpad

That then redirects to something like this:

http://ietherpad.com/1vcs1YUf1Z

How can I do this in rails?

  1. Have my rails controller new method generate a UID, and then redirect
  2. Have my rails routes somehow use that uID after the first / to find the right record and route to the right Pad Show method in the controller?

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-23T02:32:30+00:00Added an answer on May 23, 2026 at 2:32 am

    The absolute easiest way is to do this:

    In the model, have a callback

    class Thing < AR::Base
       # assuming you have a slug field
       before_create :generate_slug
    
       private 
       def generate_slug
         self.slug = some_uid_algorithm
       end       
    
    end
    

    Then in the controller, use the edit action. Use the dynamic finder find_by_slug and take in the id parameter. This returns the record if found, and returns nil if not found. If it’s not found, call create to get a new one, which invokes your slug callback.

    def edit
      @thing = Thing.find_by_slug(params[:id]) || Thing.create!
    end
    

    Direct your routes for this to the edit action of your controller. You may want a more robust way of determining what a valid slug is before you start creating records, but this is essentially how a “wiki” might work.

    This might end up creating a bunch of junk records, so you’ll want a way to sweep those. Some sort of state like “pending” or “unsaved” would take care of that – when the user updates the record, change the state from “unsaved” to “saved” and then sweep any “unsaved” docs that are 30 days old or something.

    How does that sound?

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

Sidebar

Related Questions

Prescript: The amazing etherpad was recently open sourced. Get it here: http://code.google.com/p/etherpad . This
https://github.com/ether/pad/tree/master/etherpad If you click on that, then go to bin, the URL changes, but
This Apple tech note: http://developer.apple.com/library/ios/#qa/qa2010/qa1699.html suggests storing internal user documents in a subdirectory off
I recently stumbled upon Etherpad, it's a collaborative writing tool http://code.google.com/p/etherpad/ - main project
This is my first post here and I wanted to get some input from
This is driving me insane! Here's the code: public static void main(String[] strings) {
This test checks if only one SP ends with Insert, Load, or Save, then
This is beyond both making sense and my control. That being said here is
This is my code: OleDbConnection connection = new OleDbConnection( Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\\Offline.accdb;Persist Security Info=False); connection.Open();
This is mostly a philosophical question about the best way to interpret the HTTP

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.