# כיצד לגשת למודל אחר ב-connector?

**URL:** <https://meta.discourse.org/t/how-to-access-a-different-model-in-a-connector/198916>\
**Category:** Development\
**Created:** [2 באוגוסט,‏ 2021,‏ 5:04pm UTC](https://meta.discourse.org/t/how-to-access-a-different-model-in-a-connector/198916 "2021-08-02T17:04:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)\
**Post date:** [5 באוגוסט,‏ 2021,‏ 5:22pm UTC](https://meta.discourse.org/t/how-to-access-a-different-model-in-a-connector/198916/4 "2021-08-05T17:22:37Z")

</div>

Thanks, Robin. Your tip was just what I needed. 🎉

This works, but I wonder if the direct `ajax` call is needed (when I took the connector path, I had access to the Post but not the Revision; now that I took the component path, I have access to the Revision, but not the Post 🤔)

```handlebars
{{! templates/connectors/revision-user-details-after/reply-to-editor.hbs }}
{{reply-to-editor
  postId=model.post_id
  postVersion=model.current_version
  revisionAuthor=model.username
}}

```

```handlebars
{{! templates/components/reply-to-editor.hbs }}
{{#if isVisible}}
  {{d-button
    action=(action 'replyToEditor')
    label='test'
  }}
{{/if}}

```

```js
{{! javascripts/discourse/components/reply-to-editor.js.es6 }}
import { ajax } from 'discourse/lib/ajax';

export default Ember.Component.extend({
  isVisible: true,

  didRender() {
    if (!this.get('postId')) return;

    ajax(`/posts/${this.get('postId')}`).then((post) => {
      // only show the button if the revision author is not the post author
      this.set('isVisible', this.get('revisionAuthor') !== post.username);
    });
  }
});

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-access-a-different-model-in-a-connector/198916)._
