How to make <%= link is right?

42 views
Skip to first unread message

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

unread,
Mar 28, 2018, 1:24:16 AM3/28/18
to phoenix-talk
I read that article https://hackernoon.com/writing-a-blog-engine-in-phoenix-and-elixir-part-4-adding-roles-to-our-controllers-9f4678b48468
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.

OvermindDL1

unread,
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).  :-)
https://elixirforum.com/ 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.  :-)

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

unread,
Mar 28, 2018, 1:17:07 PM3/28/18
to phoeni...@googlegroups.com
Thank you so much

Без вирусов. www.avast.com

--
You received this message because you are subscribed to a topic in the Google Groups "phoenix-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phoenix-talk/3PSF6yqANTc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phoenix-talk+unsubscribe@googlegroups.com.
To post to this group, send email to phoeni...@googlegroups.com.
Visit this group at https://groups.google.com/group/phoenix-talk.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-talk/0432a490-b60a-42cb-8d33-f09c033d0438%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages