Display message when user clicks submit button in Rails 4
<p>When a user is clicking <code>submit</code> button, we would like to display a message of <code>Please wait...'</code>. A <code>onclick</code> is added to the view file:</p>

<pre><code>&lt;%= f.button :submit, t('Save'), :class =&gt; BUTTONS_CLS['action'],  onclick: "console.log('Please wait....');" %&gt;
</code></pre>

<p>Here is the <code>html</code> source out of the above:</p>

<pre><code>&lt;input type="submit" onclick="console.log('Please wait....');" class="btn btn-default btn btn-md btn-hover btn-primary" value="保存" name="commit"&gt;
</code></pre>

<p>But nothing is happening when clicking the <code>submit</code> button. </p>