shuba.ivan
shuba.ivan

Reputation: 4071

Rails add to routing get parameters

I have some action signup and I get this aighup url to template, but need add some get parametrs like this

http://localhost:3000/signup?list_id=1

I thing like this but not work

<%= link_to 'signup', signup_url('?id='@list.id) %>

my UserNotifierMailer

UserNotifierMailer.send_signup_email(params[:email], @list).deliver

def send_signup_email(email, list)
@list = list
mail( :to => email,
      :subject => 'Thanks for signing up for our amazing app' )
end

and I have template for my email

<h1>list id <%= @list.id %></h1>
<%= link_to 'signup', signup_url %>

but in url signup need add get params

Begin when user go to the signup url with get parameters need transfer this get parameters to action and in action check if exist get parameters - some logic

How to add get parameters to some routing in template or in action and transfer to template

Upvotes: 0

Views: 52

Answers (1)

Codebeef
Codebeef

Reputation: 44036

Try

<%= link_to 'signup', signup_url(list_id: @list.id) %>

Upvotes: 1

Related Questions