How to make <%= link is right?

Skip to first unread message

Дмитрий Макаренко

Mar 28, 2018, 1:24:16 AM3/28/18
to phoenix-talk
I read that article
I have working app, but I want to make some change for better UI. 

So code in my template app.html.eex here
<%= link "Log in", to: session_path(@conn, :new) %>
Its provide a link like
<a href="/sessions/new">Log in</a>
I need a link like that 
<a href="/users/1/posts">My posts</a>

That rout is workink, but I dont know how to genetare link. Help pls. Tnx you.


Mar 28, 2018, 10:17:49 AM3/28/18
to phoenix-talk
As a note, the stickied post of this mailing list states that this mailing list is deprecated, so it's not watched anymore (I saw your post by accident).  :-) is where it is now.  :-)

However, the answer to your question is that you just update the path as appropriate, so you'd change `session_path(@conn, :new)` into whatever you built it to be, so as an example something like `users_path(@conn, :index, 1)` or whatever you set it up to be.  :-)

Дмитрий Макаренко

Mar 28, 2018, 1:17:07 PM3/28/18
Thank you so much

Без вирусов.

You received this message because you are subscribed to a topic in the Google Groups "phoenix-talk" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit

For more options, visit

Reply all
Reply to author
0 new messages