# הוספת טופס לפלאגין

**URL:** <https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203>\
**Category:** Development\
**Created:** [18 בינואר,‏ 2022,‏ 10:10am UTC](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203 "2022-01-18T10:10:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![alangibson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alangibson/32/245888_2.png) [@alangibson](https://meta.discourse.org/u/alangibson)\
**Post date:** [18 בינואר,‏ 2022,‏ 10:10am UTC](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203/1 "2022-01-18T10:10:10Z")

</div>

I’m trying to create a simple plugin that

- adds a form above the topic timeline
- POSTs email address that user enters to a controller

The form is rendered above the timeline, but when I enter an email and click the submit button, I get this error in the browser console:

```plaintext
DEBUG: -------------------------------
vendor.js:49192 DEBUG: Ember : 3.15.0
vendor.js:49192 DEBUG: jQuery : 3.6.0
vendor.js:49192 DEBUG: -------------------------------
vendor.js:4180 [Violation] 'setTimeout' handler took 489ms
[Violation] Forced reflow while executing JavaScript took 35ms
vendor.js:49192 DEBUG: For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi
user-presence.js:77 [Violation] 'setInterval' handler took 51ms
vendor.js:49170 Uncaught Error: Assertion Failed: <@ember/component:ember716> had no action handler for: lonerWatch
    at assert (vendor.js:49170)
    at Class.send (vendor.js:44642)
    at Class.superWrapper [as send] (vendor.js:43919)
    at Class.send (plugin-connector.js:75)
    at Class.superWrapper [as send] (vendor.js:43919)
    at vendor.js:22103
    at instrument (vendor.js:50635)
    at vendor.js:22102
    at Backburner._run (vendor.js:67048)
    at Backburner._join (vendor.js:67024)

```

The (currently incomplete) code is:

`/assets/javascripts/discourse/templates/connectors/topic-navigation/loner-watch-topic-form.hbs`

```plaintext
<form {{ action 'lonerWatch' content on='submit' }}>    
    <p>Enter your email address to watch this topic for updates</p>
    <input name="email" placeholder="Your email"/>
    <button>Watch</button>
</form>

```

`/assets/javascripts/discourse/controllers/loner-watch-topic-form.js.es6`

```plaintext
export default Ember.Controller.extend({
    actions: {
      lonerWatch(content) {
        console.log(content);
      }
    }
  });

```

`/controllers/loners_controller.rb`

```plaintext
class LonersController < ApplicationController
   [...]
    # Watch topic as a staged user
    def watch
      user = ensure_user
      topic = Topic.find(params[:topic_id].to_i)
      TopicUser.change(user, topic.id, notification_level: params[:notification_level].to_i)
    end
  end

```

I’m sure I’m missing something simple here, but I’m just not seeing it. Any help is appreciated.

---

_[View the full topic](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203)._
