Reputation: 633
I am new to rails and wanted to know what are some of the ways to include html files in rails- from public folder, from views folder or any other method if any.
Upvotes: 2
Views: 6753
Reputation: 2872
stop thinking and use jQuery
html
<div id="here"></div>
jquery
<script>
$('#here').html("<%= j(render partial: 'profiles/users') %>");
</script>
Upvotes: 0
Reputation: 2845
In Rails, You put your view files in app/views/controller_name/action_name.html.erb
Take a look at this to get a better understanding -- http://blog.codinghorror.com/understanding-model-view-controller/
Also consider doing the Rails Tutorial(Hartl), that should get you started in understanding how the framework works.
Update
Change your header.html, and rename it to _header.html.erb
in your action_name.html.erb,
write
<%= render 'header' %>
the _ denotes that it's a partial
Upvotes: 2