# Render Rails custom view from plugin

**URL:** <https://meta.discourse.org/t/render-rails-custom-view-from-plugin/149830>\
**Category:** Development\
**Created:** [April 29, 2020, 9:54pm UTC](https://meta.discourse.org/t/render-rails-custom-view-from-plugin/149830 "2020-04-29T21:54:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)\
**Post date:** [April 29, 2020, 9:54pm UTC](https://meta.discourse.org/t/render-rails-custom-view-from-plugin/149830/1 "2020-04-29T21:54:39Z")

</div>

Hello,

I’m working on a plugin that renders a Rails view on a specific path. I add the controller but when trying to render this specific controller action it says the view for the action doesn’t exist.

Debugging for a bit I found that the plugin `views` path is not available to Rails, only `discourse/app/views` and `docker_manager/app/views`.

I added this to the controller in order to add `views` to list of places where Rails will look

```ruby
module DebtcollectiveSso
  class ApplicationController < ::ApplicationController
    before_action :prepend_plugin_view_path

    def prepend_plugin_view_path
      prepend_view_path(Rails.root.join('plugins', 'discourse-debtcollective-sso', 'app', 'views'))
    end
  end
end

```

I feel this shouldn’t be needed but I may be wrong. Is this the right approach or I’m doing something wrong?

Thanks!
