I want if some click on my “link” then it should open in a new tab/window. Here is my link-
<%= link("Candidate's Detail", to: Routes.job_open_path(@conn, :show, @job_opening.id), method: :get)%>
Your response will be highly appreciable.
I want if some click on my “link” then it should open in a new tab/window. Here is my link-
<%= link("Candidate's Detail", to: Routes.job_open_path(@conn, :show, @job_opening.id), method: :get)%>
Your response will be highly appreciable.
You can add a target: “_blank” option to the link tag, as below ( I splitted it in rows for better visibility)
<%= link("Candidate's Detail",
to: Routes.job_open_path(@conn, :show, @job_opening.id),
method: :get,
target: "_blank") %>
Hth.
Thanks bro.
ur welcome bro
For security reasons, you should also add rel="noopener"
. To protect user’s privacy you could also add rel="noreferrer"
. So the full example would be:
<%= link("Candidate's Detail",
to: Routes.job_open_path(@conn, :show, @job_opening.id),
method: :get,
target: "_blank",
rel: "noopener noreferrer") %>
Thank you @michallepicki. I just learned about the target=“_blank” vulnerability, well… better late than ever!
Woow…Great