Why don't you define a route for this, instead of assembling this the path yourself this way? 

For example, you can just do 

get "/register/:token", to: "users#invite_user", as: :invite_user

then you can use "invite_user_path(a_token)" in your code.