Maxence
Maxence

Reputation: 2339

Link_to root_path not working in mail view

I am trying to add a basic link_to tag to a mail view.

notification.html.erb:

<%= link_to image_tag('S200.gif'), root_path  %>

error is undefined local variable or method 'root_path' Not very sure why as same bit of code (different image only) works perfectly fine in a normal controller view. root_path is correctly set in routes.

Does the mail view prevent it ?

Upvotes: 1

Views: 949

Answers (1)

jvillian
jvillian

Reputation: 20263

I believe the answer is 'yes'. I was just reading the docs this morning, and my understanding is that you need to use _url instead of _path.

Upvotes: 2

Related Questions