In the view's HTML, the text area and submit button would be part of a form, and that form's action
attribute would point to ''
and you'd put a part into the same controller that generated that view that checks for POST data. If there's POST data, you'd write it to the database.
The form would look something like this:
<form action='' method='post'>
<textarea name="text"></textarea>
<input type="submit" value="Submit"/>
</form>
In the POST, you'll see a variable with a key that matches the name
attribute of the textarea (in this case, text
). You can read it from there.
If you like, you can also change the action
attribute on the form to a URL, in which case you'd write the part that checks the POST data in a controller that that URL points to.