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,
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
Hi!
In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir?
Searched the docs for ip address and the web, no good results.
Thanks!
New
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
Hi everyone,
I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
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
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Other popular topics
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Lets say I have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!)
This post collects co...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
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









