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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:53:49+00:00 2026-05-20T07:53:49+00:00

I am trying to write a viral pre-beta invitation application as one can see

  • 0

I am trying to write a “viral” pre-beta invitation application as one can see on usehipster.com or fork.ly.

Basically, the future tester:

1.) enters his email

2.) is redirected to a view (a coming_soon page)

3.) receive a link like this one : “http://localhost:3000/?referred_to=the tester’s invitation id” displayed in the view.

4.) and receive an email with the same link.

If I understand it well, the “tester’s invitation id” acts as a token in order to track from which testers the invitation come from.

My questions:

1.) How can I generate the id in the link? I cannot use before_create cause the invitation id is not already set up when a tester registered.

I tried this:

in the invitation controller

def coming_soon
  @invitation = Invitation.last
end

in views/invitations/coming_soon.html.erb

...
Copy and paste the following link to share wherever you want!</p>

<%= text_field_tag 'code', root_url + "?reffered_by=" + @invitation.id.to_s %>

Do you think they do like this?

2.) Why there is a question mark in the link? (or something like ?reffered_by= why not just root_url/@invitation.id.to_s) This is something related to the routes? is it a get method?

Thanks for your help!

  • 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-20T07:53:50+00:00Added an answer on May 20, 2026 at 7:53 am

    I will answer question 2:

    ? in url is a way to pass parameters. A form using GET method uses this sort of appending to url to pass parameters. URL ?reffered_by=somevalue passes the parameter referred_by with value somevalue. Now if in our controller, we want this value, we can call params[:referred_by] and we will get the value as “somevalue”. If we want to pass more than one parameter, we can pass it using &. For example,

    "#{root_url}?referred_by=#{@invitation.id}&referred_time_stamp=#{Time.now.strftime(%Y%m%d%H%M%S)}"
    

    Now, we can access these parameters in controller as params[:referred_by] and params[:referred_time_stamp].

    If you have no routes or resources defined in routes.rb, you cannot pass parameters like id using
    "#{root_url}/#{@invitation.id}". For example, when you define

    map.connect ':controller/:action/:id'
    

    in routes.rb, then it understands the part coming after last slash is the value of parameter id and we will get it as params[:id] in the controller.

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

Sidebar

Related Questions

Trying to write a code at the moment that basically tests to see if
Trying to write a trivial application, But I have stuck into one of the
Trying to write a chat, like on facebook, I wondered if two clients can
Trying to write a function to see how often an object exists and give
Trying to write a simple C# script to copy file to directory one level
I've been stuck trying to write this regular expression I need. Basically, I have
Trying to write a regex that can parse a full name and split it
Trying to write a conditional with jQuery that basically states, if div.gathering does not
Trying to write a python application that downloads images from an RSS feed, and
I've been trying write an application which will be able to connect to a

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.