Hi. Got a strange bug with .html.erb when calling from my controllers
#Views
(in list.html.erb)
[...]
<table id="articles" cellpadding="0" cellspacing="0" class="crud">
<%= render :partial => 'list' %>
</table>
[...]
(in _list.html.erb)
<thead>
<tr>
<th <%= th_class 'title'%>><%= sort_link 'Title', 'title', 'articles' %></th>
[...]
#Helper
(in application_helper.rb)
[...]
def sort_link(text, params, update)
[...]
options = {
:url => {:action => 'list', :params => params.merge({:sort => key, :page => nil})},
:update => update,
:before => "$('spinner').show();",
:complete => "$('spinner').hide();"
}
[...]
link_to_remote(text, options, html_options)
end
#Controllers
(in articles_controller.rb)
def list
[...]
respond_to do |format|
format.html { render :action => 'list' }
format.js { render :partial => 'list' }
end
end
===============================================
when calling list as html (articles/list), no problem
when calling list as js, if partial => 'list' is '_list.rhtml', no problem, but if partial => 'list' is '_list.html.erb', got the following exception:
Couldn't find template file for admin/articles/_list in ["/home/mulasse/rails/cobalt_blog/app/views"]
(ActionView::ActionViewError).
Is that a normal behavior please?