Trip
Trip

Reputation: 27114

How do I add an instance variable inside of a link_to?

For example, I would like to make this :

= link_to 'Click this link!", 'http://www.mydomain.com/#{@id}/manage', :target => '_blank'

This is getting sent as an email..and the @id is coming from my Notifier model..

Any ideas?

Upvotes: 0

Views: 850

Answers (1)

Trip
Trip

Reputation: 27114

Fell for it again! I had to make those double quotes like this :

 = link_to 'click here.', "http://www.mydomain.com/#{@org_id}/manage", :target => '_blank'

Back to rails school I go

Upvotes: 1

Related Questions