TheC4keIsASpy
TheC4keIsASpy

Reputation: 71

Render view inside a view

I have a website which requires something like this:

index.html.erb:

<div>
  <%= render "hello" %>
</div>

hello.html.erb:

whatever content is other here

That doesn't work since hello is not a partial. But is there a way to make render work anyways? (maybe not using render ^^)

And no, changing hello.html.erb to a partial is not an option, "hello" is a separate page which CAN be displayed on it's own.

I could use an iframe... but I'd rather stick to rendering the page server-side :)

Upvotes: 0

Views: 65

Answers (1)

zwippie
zwippie

Reputation: 15525

I think you can use render template:

render template: 'hello' # should render hello.html.erb

or

render template: 'products/show' # render views/products/show.html.erb

Upvotes: 2

Related Questions