dewie

dewie

Liveview heex template variable scope errror

I have a problem with variable scopes in a heex template (phoenix 1.7 rc1)

#<%= inspect @record.view_item_id %>#
<label><%= gettext("Column") %>:</label>
<select name="view_item_idasdfdf_dadf" class="">
  <%= for item <- @columns do %>
    <option value={item.id}>
      <%= item.label.nl %>#<%= @record.view_item_id %>#
    </option>
  <% end %>
</select>

The assigns in the select element don’t work, resulting html output:

<div class="form-group">
  #"5503d42e64657647e0000000"#
  <label>Column:</label>
  <select name="view_item_idasdfdf_dadf" class="">
    
    <option value="5503d42e64657647e0000000" selected="">Klant##</option>
    
    <option value="5503c2c064657637f4010000">Soort##</option>
    
    <option value="55efd0cc0c08dc13b3000000">Kenmerk##</option>
    
    <option value="5503c2e464657637f4050000">Omschrijving##</option>
    
    <option value="588c69a20c08dc7676000000">Serienummer##</option>
    
    <option value="56115aa20c08dc27f1000000">Status##</option>
    
  </select>

</div>

Anyone an idea ?

Marked As Solved

dewie

dewie

Fixed, it was in a .modal component and the first select get’s the focus so won’t change …

Where Next?

Popular in Questions Top

lessless
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
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Kagamiiiii
Student &amp; New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
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
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

We're in Beta

About us Mission Statement