Displaying 1 result from an estimated 1 matches for "qalayout".
Did you mean:
layout
2008 Jul 21
0
Re: Listing user jobs
I have been able to list all jobs for a user with the following code:
In application_helper.rb:
def userjobs
userid = current_user.id
@jobs = Job.find(:all, :conditions => { :user_id => userid })
return(@jobs)
end
In application.rb:
helper :application
In qalayout.html.erb:
<% if logged_in? %>
<a href="javascript:;" onmousedown="toggleDiv(''viewjobs'');">View your
jobs</a>
<div id="viewjobs" style="display:none">
<% @jobs = userjobs() %>
<% for job in @jobs...