Daniel
Daniel

Reputation: 1755

How to include erb file on another?

I have template file .erb with HTML code inside.

How to include it in another file erb?

I tried to use section but this is not that I need

Upvotes: 1

Views: 3275

Answers (2)

Mizuki
Mizuki

Reputation: 2233

Following code work for me

 <%= render :partial => 'yourFile' %>

Upvotes: 0

Ilya
Ilya

Reputation: 13477

You are looking for render:

<%= render('file_folder/other_file') %>

Note, that you can omit .html.erb part of the file name.

Upvotes: 4

Related Questions