Ryan Bigg wrote:
> Use restful authentication (or a similar plugin) for tracking that
> kind of stuff: http://github.com/technoweenie/restful_authentication
> -----
> Ryan Bigg
> Freelancer
> http://frozenplague.net

Couldnt I just do the following... in my projects controller?


before_filter :find_projects

def index
  #  @projects = Project.find(:all)
  #  @project_company = @projects.company_id
    @projects = @results.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @projects }
    end
  end

def find_projects
    @user_in = Person.find_by_id(session["user_id"])
    @company = Company.find_by_id(@user_in.company_id)
    @results = Company.find(@company.id).projects # Find all projects 
that belong to company
  end
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to