Strange view problem

I'm working with a Struct that I mapped from a raw sql query for a
report. I finally get the search page to work and display my results,
however the view when rendered not only displays the expected output;
it also shows the Struct as it would look in the rails console!

my view is as follows:

<%=form_tag request.path,:method=>'get' do%>
<%=submit_tag "Search",:name=>nil%>

<div id="list">

<%=@assigned_students.each do |student| %>
<%= render :partial => 'assigned_student',:collection=>student %>

The partial is as follows:

<%if @assigned_students.kind_of?(Array)%>
<%=@assigned_students.each do |f|%>

<p><%=@assigned_students.advisor%> </p>
<p><%=@assigned_students.semester%>> </p>

The relevant controller code is as follows: (I've removed the sql
query string itself for readability.),:advisor,:semester)
def advisor_list

respond_to do |format|
  unless params[:advisors].nil?
        #long query removed from here{|m|["Student
    end #end respond_to
    end #ends unless
  end # ends method

Does anyone here understand what could be the problem?

I've had this before, too. But not so recently that I readily remember what was wrong. Cobwebs suggest it was not much more than a syntax error.

In your controller you have a close brace but no open brace, which causes my eye to notice that you also have two format.html calls. Is there something else missing, or could that be the issue?

Try removing stuff from your view until the unexpected output
disappears, then you will know which line of code is showing the
unwanted output. I hope you are using a Source Control System such as
git so that you can easily get back to where you started.


Take the "=" out of the front of the .each call.

Removing the entire loop from the calling view seems to have solved
the issue. Thanks everyone.

@Jim I was trying to have the partial render on the same page that the
search was being done on to see whether the output was different on
that page. That code is such a dirty hack as it stands right now.