Partial template problem

Hi all,

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

listing for traces.html.erb

<%= 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}
  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:

  • DDService
    ID-swordfish-27243-1327514975752-13-85879

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.

On Thu, Feb 16, 2012 at 6:22 PM, Naira K. [email protected]
wrote:

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.

 <a href="<%=
<%= link_to trace.exchange_id,

@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).

match ‘esb/list_traces_by_original_exchange_ids/:original_exchange_id’
<a

HTH,

Peter


*** Available for a new project ***

Peter V.
http://twitter.com/peter_v
http://rails.vandenabeele.com
http://coderwall.com/peter_v