title: Flask - generate url with parameters in html
body: <p>I am trying to find how I can pass a URL parameter (not request) into the <code>url_for</code> function, but I cant find it. In the following example, I need to pass the <code>q_id</code> through the form, as I do with <code>incrRight</code>. So, how can I have variables in <code>url_for</code> in this scenario ?</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="{{url_for('answer',q_id='5495eb77433f064294361ceb')}}" method="post"&gt;
      &lt;input type="text" name="incrRight" value="0"&gt;
      &lt;input type="submit"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is what I have on my controller:</p>
  
  <pre><code>@app.route('/api/v1.0/question/&lt;string:q_id&gt;/answer', methods = ['POST'])
  def answer(q_id):
      incrRight = request.form.get('incrRight')
      . . .
  </code></pre>
  
  <p>I need my html form to be able to communicate with the above function, by passing a q_id and the incrRight parameter.</p>