damn, i'm still seeing the same error with your suggestion...

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

it's something else I guess.

I used...

class WelcomeController < ApplicationController
  def index

    unless params[:location][:id] || params[:location][:id].empty?
      # location is set, so find it!
      @location = Location.find(params[:location][:id])
    else
      # location is empty, so just get all the teachers
      @teachers = Teacher.all
    end

  end


end

and went to

http://localhost:3000/

parameters = none


-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to