thojanssens1
Adding a query string to a redirection
Hi
How can I add a query string like ?foo=bar?
redirect(conn,
to:
Routes.user_path(
conn,
:show_user,
some_param,
other_param
)
)
I can’t find an option for adding a query string in the redirect helper.
Marked As Solved
LostKobrakai
That’s because redirect works with any path/url and get params are just a part of them:
Routes.user_path(
conn,
:show_user,
some_param,
other_param,
foo: "bar"
)
2
Also Liked
LostKobrakai
if(is_active, do: 1, else: 0)
The above is hardly longer than something akin to a ternary operator, but using the default elixir keyword syntax. Meaning nothing had to be created to support it.
2
Last Post!
OvermindDL1
active: is_active && 1 || 0
This is not a recommended pattern, and it can fail in a couple of surprising ways (specifically if the 1 in the above example where nil or false because it interprets it as active: (is_active && 1) || 0), but it’s the bash’ism style, that works in Elixir too. ^.^;
0
Popular in Questions
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
I would like to know what is the best IDE for elixir development?
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
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
Hello everyone,
I try to use an Javascript Event Handler in my root.html.leex file.
Therefore I created a function in the app.js file: ...
New
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
I would like to know what is the best IDE for elixir development?
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
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
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
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
Latest Phoenix Threads
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
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









