raffir
7/23/2006 3:30:00 PM
Unfortunately, while it's now showing accounts, it's now showing every
single account. I'd just like it to show accounts with the same name as
the session user's.
Thanks,
- Raffi.
Jan Svitok wrote:
> Hi,
>
> On 7/23/06, raffir@gmail.com <raffir@gmail.com> wrote:
> > I'm working on a project in which Accounts belong to a User.
> > <table>
> > <%@session['user'].accounts.each do |i| %>
> > <%Accounts.find(:all, conditions = ["coursename LIKE ?",
> > "%#{i.coursename}%"])%>
>
> You're missing second 'each' here
> <%Accounts.find(:all, conditions = ["coursename LIKE ?",
> "%#{i.coursename}%"]).each do |account| %>
>
> > <tr>
> > <td><%= account.name %></td>
> > <td><%= account.number %></td>
> > <td><%= account.user_id%></td>
> > </tr>
> > </table>
> > <%end%>
> >
> > <% end %>