It would be best to call partial elements from index.html.erb
<% unless params[:check].nil? %> <%= render :partial => '/layout/check' %> <% else %> <%= render :partial => '/layout/not_check' %> <% end %>
so your def index will look like this
def index respond_to do |format| format.html end end
I did not understand what you are trying to do, but the partial ones related to the controller / actions should not be in the layout if they do not serve any layout.
source share