Simple form input

I’m currently working on a very simple WebApp that requires a simple form input. All I need is to get the value of the text input from the HTML to the Elixir Backend Code. Yet the only real tutorials and Guides for this involved Changesets and other Database related solutions. How can I just simple get the value of a Form in a Post request?
Or: What is the Elixir Phoenix equivalent to this in Python Flask?

request.form['text']

Take a look at the second argument of your controller. It will contain all the params submitted with the request.

I dont see the text input show up in the Parameters of the request.
This is the form I’m using:

<%= form_tag("/", method: :post) %>
    <input type="text" placeholder="Command">
    <input type="submit" value="Submit">
  </form>

But the Parameters dont show any of the text in the field.

Parameters: %{"_csrf_token" => "AT53CR4lYTkBU2U8FgtrMgAUDDY8BTQnf_FQmi1kp75rcZZFscGFDjRM", "_utf8" => "✓"}

How do I get the text from the form?

Because it has no name.

1 Like