skanel

skanel

Bootstrap link vs phoenix link `<%= link ..`

I have integrated bootstrap 4 successfully into my project, then I am trying to do

<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>

I am trying to use phoenix template system , so I changed

<%= link "Home", to: page_path(@conn, :index), class: "nav-link" %>

How can I put
<span class="sr-only">(current)</span> into the phoenix template system.

Marked As Solved

NobbZ

NobbZ

Roughly like this:

<%= link raw(~s'Home <span class="sr-only">(current)</span>'), to: page_path(@conn, :index), class: "nav-link" %>

Phoenix.HTML.raw/1

Also Liked

LostKobrakai

LostKobrakai

This should work as well.

<%= link to: page_path(@conn, :index), class: "nav-link" do %>
    Home <span class="sr-only">(current)</span>
<% end %>
10
Post #5

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New

We're in Beta

About us Mission Statement