0

I have a UsersController and RegistrationsController to handle user signups with Devise in rails.

I am adding code for affiliate sign ups, in order to map users to affiliates using a custom HTTP GET parameter called "a".

So for example, I want my sign up to respond like this: www.app.com/users/sign_up?a=affiliate_code

However, Rails doesn't respond to params[:a] in the controller. In my routing file, all I have is resources :users

What is the easiest and most rails way to implement this?

bluebit
  • 2,987
  • 7
  • 34
  • 42

2 Answers2

0

You need to setup the action sign_up in routes.rb or you can use the default new method to create a user. Then you should get the params 'a' without problem.

Matteo Alessani
  • 10,264
  • 4
  • 40
  • 57
0

Add this line to routes:

match 'users/sign_up', :to => 'users#new' 
tjeden
  • 2,019
  • 1
  • 13
  • 19