here is what I’m trying to do:
page.replace_html('manage_categories_list', :partial => "/categories/categories", :layout => :modal)
But, I get this error on the above code:
NoMethodError (undefined method `include?' for :modal:Symbol):
What I want to be able to do, is have template HTML for a modal dialog window. And set the header (h2) and the body (div) of that modal with any partial. =\
modal.html.erb:
<div class="fixed_modal">
<div class="modal_header">
<%= yield :header %>
</div>
<div class="modal_body">
<%= yield %>
</div>
</div>
The partial I’m trying to render:
<% content_for :header do %>
Manage Categories
<% end %>
…. rest doesn’t matter as it just goes into the yield
I’m using rail 2.3.14
Most likely, you need to change it to
..., :layout => 'modal':The #replace_html method accepts options like #render. For the :layout option, you either need to pass
true, or a string layout file name (See the docs for #render).The layout argument will be the ‘xyz’ part of the filename in app/views/layouts/xyz.html.erb.