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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:09:58+00:00 2026-06-09T07:09:58+00:00

As a learning experience for Ruby and Rails, I am creating a website for

  • 0

As a learning experience for Ruby and Rails, I am creating a website for taking polls, stores the results, etc. As part of the polling process, a user has to go through a number of questions and provide answers to those questions. When they are done, they receive a list of recommendations based upon the answers they provided (of type Answer).

I have two parts to my question. One, I think I am heading down the right path. The other, I’m not even sure where to begin, and don’t know if it is a good idea.

Here is my Answer model:

class Answer
  attr_accessor :question_number, :description, :answer
end

Question 1

I am looking for a way that, when the user submits all the answers (I’m storing their responses in session storage), it goes to my search function – but it is encoded nicely.

Instead of:

http://localhost:3000/results/search?[biglongstringofdifferentanswers]

I would like something like:

http://localhost:3000/results/search/1-answer_2-answer_3-answer

After doing some searching, it seems that what I want to accomplish has to be done with the #parameterize method, but I’m not sure I understand how to do that exactly.

Question 2

The second part to my question is – can I encode my answers so that they aren’t directly human readable. I want to do this to prevent people from browsing to each other’s answers. For example, the first answer is always the person’s unique ID and I don’t want to someone to be able to just browse to any old set of results by switching around parameters.

So, I am hoping to get something along the lines of:

http://localhost:3000/results/search/798dh832rhhbe89rbfb289f9234972bdbdbbws3

For this second question, I’m not even sure if this is a good idea, so I’m open to suggestions for this one.

Appreciate any help and guidance on these questions as I continue to explore/learn Ruby and RoR.

  • 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-09T07:10:00+00:00Added an answer on June 9, 2026 at 7:10 am

    If I get it right, there is not any login system and you want submitted answers that you store in your DB to be accessable via url for the user. You said you don’t want users to navigate to other users’ answers but the user getting the url can still share it.

    What I would do is to submit answers via POST method, so you don’t have to worry about encoding your params etc. It gets then real easy with Rails.

    You can add a public_id column to your answer object that would be a generated big int. After the post methoded submit, once you save the answer in your DB, you could return a redirect to the answer public id url.

    something like

    def create
      answer = Answer.new(params[:answer])
      if answer.save
        answer.generate_public_id # <= would be nice to add if in the answer model 'after_create' filter probably
        return redirect_to public_id_answer_path
      end
      render :partial => 'error'
    end
    

    What do you think ?

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

Sidebar

Related Questions

I'm just learning Ruby on Rails (no prior Ruby experience) I have these models
As part of learning ruby/rails, I'm trying to implement http://github.com/professionalnerd/simple-private-messages into my application from
I have 2 years of experience in Ruby on Rails. I have basic knowledge
I'm a Ruby on Rails newbie. I'm learning Rails in my spare time (my
I am learning Ruby On Rails. I am on a shared hosting with Ruby
As an experienced .NET developer, I am interested in learning the Ruby on Rails
I'm learning ruby on rails on a linux box and dusting off my VIM
I am an experienced programmer learning Ruby (and liking it a lot). I'm working
Just as a learning experience, I'm trying to code the following problems in C.
I'm working through a small file upload script (learning experience) and I noticed that

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.