Forum: Ruby on Rails Select error while creating it

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
334ae822566107a2ea2b7a7cb88bd1d6?d=identicon&s=25 brutyn_nick (Guest)
on 2005-11-23 17:02
(Received via mailing list)
hey,

i get this error (local it works right), online it is fucked

<p><label for="time_entry_geotag_id">Geotag:</label><br />
<%= select "time_entry", "geotag_id", @geotags.collect
{|g| [g.address1 + " (" + g.client.name + ")",g.id]} %></p>

@geotags = Geotag.find_all_by_firm_id(firm_id, :order =>"address1 ASC")
@geotag_options = [["All","%"]] + @geotags.collect
{|g| [g.address1 + ", " + g.city + " (" + g.client.name + ")" ,g.id]}

my error

You have a nil object when you didn't expect it!
The error occured while evaluating nil.name

Extracted source (around line #7):

4: <%= select "time_entry", "employee_id", @employees.collect {|e|
[e.last_name + " " + e.first_name,e.id]} %></p>
5:
6: <p><label for="time_entry_geotag_id">Geotag:</label><br />
7: <%= select "time_entry", "geotag_id", @geotags.collect {|g|
[g.address1 + "(" + g.client.name + ")",g.id]} %></p>
8:
9: <p>
10: <label for="time_entry_start_time">Start time</label>
(yyyy-mm-dd hh:mm:ss)<br/>
This topic is locked and can not be replied to.