niccolox
Live Render a single word with no wrapping div
I want to use a Phoenix LiveView to render a single word in HTML head in the root.html.heex.
LiveView looks like
def render(assigns) do
~H"""
<%= @website.theme %>
"""
end
when I live_render
<html lang="en" data-theme={live_render(@conn, AppWeb.DataThemeLive)}>
I get
<div data-phx-session="SFMyNTY.g2gDaAJhBXQAAAAIZAACaWRtAAAAFHBoeC1GdTFmRXMyNFZWbkt1cGhGZAAMbGl2ZV9zZXNzaW9uaAJkAAdkZWZhdWx0bggAqWbAmQtf7RZkAApwYXJlbnRfcGlkZAADbmlsZAAIcm9vdF9waWRkAANuaWxkAAlyb290X3ZpZXdkACVFbGl4aXIuRm9sa2JvdFdlYi5UaGVtZXJEYXRhVGhlbWVMaXZlZAAGcm91dGVyZAADbmlsZAAHc2Vzc2lvbnQAAAAAZAAEdmlld2QAJUVsaXhpci5Gb2xrYm90V2ViLlRoZW1lckRhdGFUaGVtZUxpdmVuBgDIILangAFiAAFRgA.Q1XE8aDzcsIzYo8xqeCas-eeUWCrmt2lt6KCbVNczww" data-phx-static="SFMyNTY.g2gDaAJhBXQAAAADZAAKYXNzaWduX25ld2pkAAVmbGFzaHQAAAAAZAACaWRtAAAAFHBoeC1GdTFmRXMyNFZWbkt1cGhGbgYAyCC2p4ABYgABUYA.AdiJYO5X_LdaUNoE391eDDRRtpaFWgPySEKI4jJI-TI" id="phx-Fu1fEs24VVnKuphF">
synthwave</div>
Which is broken HTML.
Unsure what the best approach to resolve this is.
Marked As Solved
BartOtten
Popular in Discussions
Hi everyone, im working on find best language/framework/system for
high concurrency, high performance and stable performance
after wor...
New
I have a sample string
sentence = "Hello, world ... 123 *** ^%&*())^% %%:>"
From this string, I want to only keep the integers, ...
New
Just saw that dhh announced https://hotwire.dev/
Is it just me or is this essentially live view? :smiley:
Although I like the “iFrame-e...
New
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
I’m still quite new to Elixir.
As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?:
de...
New
Hi all,
In the last days, two things happened:
A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
Got a question about when to concat vs. prepending items to list then reversing to achieve appending.
So i know lists boil down to [1 | ...
New
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
New
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
Other popular topics
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
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
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
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
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









