Ceejay
Ceejay

Reputation: 7257

Rails not rendering view in custom page

I am trying to render contents of user_details\index.html.erb in my custom page home.html

here is my directory structure

apps
|
views
├───co_owners
├───layouts
├───pages
├───shared
└───user_details

the home.html.erb page is pages directory... and index.html.erb pages is in user_details directory

i am using <%= render :partial => 'user_details' %> to render it on my home page... but i am getting error ActionView::MissingTemplate in Pages#home

how can i do this?

Upvotes: 0

Views: 121

Answers (1)

Roman Kiselenko
Roman Kiselenko

Reputation: 44360

As an answer in a previous your question

It is not a partial (starts with underscore), so you need render template. You also need the full path of the template, from the view directory:

<%= render template: 'user_details/index' %>

I suggest you read Layouts and Rendering in Rails

Upvotes: 1

Related Questions