Partial template problem

Hi all,

I am trying to render a partial template but it is not been rendered.

listing for traces.html.erb

<div class="row">   <div class="four columns">     <nav>     <ul class="list group">   <% @all_traces.each do |trace| %>     <li>       <a href="<%= traces_by_orig_exchange_id_path(trace.original_request_id) %>">       <h6>         <%= trace.headers%>       </h6>        <%= trace.original_request_id %></a></li>      </li>   <% end %>   </ul>     </nav>     </div>

  <div>     <%= render :partial => 'traces_by_original_exchanges', :collection => @traces_by_original_exchanges, :as => :trace %>   </div>

</div>

listing _traces_by_original_exchanges.html.erb <tr>   <td><%= link_to trace.exchange_id, trace_by_trace_id_path(trace.trace_id) %></td> </tr>

listing my_controller.rb

def list_traces_by_original_exchange_ids     @tbl_trace = TblTrace.new     @traces_by_original_exchanges = @tbl_trace.list_traces_by_original_exchange_ids(params[:original_exchange_id])

    respond_to do |format|       #format.html # show.html.erb       format.html { redirect_to traces_url}       format.js       format.json { render :json => @traces_by_original_exchanges }     end   end

listing route.rb   match 'esb' => 'esb#index'   match 'esb/index' => 'esb#index', :as => :esb_home   match 'esb/traces' => 'esb#traces', :as => :traces   match 'esb/list_traces_by_original_exchange_ids/:original_exchange_id' => 'esb#list_traces_by_original_exchange_ids', :as => :traces_by_orig_exchange_id

My resulting html page always shows: <div class="row">   <div class="four columns">     <nav>     <ul class="list group">     <li>       <a href="/esb/list_traces_by_original_exchange_ids/ID-swordfish-27243-1327514975752-13-85879">       <h6>         DDService       </h6>        ID-swordfish-27243-1327514975752-13-85879</a></li>      </li>   </ul>     </nav>     </div>

  <div>     <!-- partial expected to display here -->   </div>

</div>

I have little knowlegde of ruby though, but the tutorial I have read so far, it looks like I have done the right thing.

Can someone please tell me why this is not working?

Regards.

Hi all,

I am trying to render a partial template but it is not been rendered.

What is being rendered then if it is not the partial template?

I have asked a further question further down this mail.

listing for traces.html.erb

<nav>

<ul class="list group">

<% @all_traces.each do |trace| %>

<li>

  <a href="<%=

traces_by_orig_exchange_id_path(trace.original_request_id) %>">

  <h6>

    <%= trace.headers%>

  </h6>

   <%= trace.original_request_id %></a></li>

 </li>

<% end %>

</nav>

</div>
<%= render :partial => 'traces_by_original_exchanges', :collection

=> @traces_by_original_exchanges, :as => :trace %>

listing _traces_by_original_exchanges.html.erb

<%= link_to trace.exchange_id,

trace_by_trace_id_path(trace.trace_id) %>

listing my_controller.rb

def list_traces_by_original_exchange_ids

@tbl_trace = TblTrace.new

@traces_by_original_exchanges =

@tbl_trace.list_traces_by_original_exchange_ids(params[:original_exchange_id])

respond_to do |format|

  #format.html # show.html.erb

  format.html { redirect_to traces_url}

I am confused about this. If the format.html is a redirect_to, I am not sure how anything is rendered at all (but I did not look in full detail in your code).

format.js

  format.json { render :json => @traces_by_original_exchanges }

end

end

listing route.rb

match ‘esb’ => ‘esb#index’

match ‘esb/index’ => ‘esb#index’, :as => :esb_home

match ‘esb/traces’ => ‘esb#traces’, :as => :traces

match ‘esb/list_traces_by_original_exchange_ids/:original_exchange_id’

=> ‘esb#list_traces_by_original_exchange_ids’, :as =>

:traces_by_orig_exchange_id

My resulting html page always shows:

<nav>

<ul class="list group">

<li>

  <a

href=“/esb/list_traces_by_original_exchange_ids/ID-swordfish-27243-1327514975752-13-85879”>

  <h6>

    DDService

  </h6>

   ID-swordfish-27243-1327514975752-13-85879</a></li>

 </li>
</nav>

</div>
<!-- partial expected to display here -->

HTH,

Peter