Displaying 2 results from an estimated 2 matches for "allmappoint".
Did you mean:
allmappoints
2006 Jul 02
1
Subject: Trying to Get Results from Form Element
...p
Couldn''t find Gmap without an ID
Request
Parameters: {"commit"=>"Show Map", "mapPoint"=>{"id"=>"5"}}
==Code Extract from index.rhtml==
<%= start_form_tag( :action => "displayGMap" ) %>
<% mapPoints = Gmap.allMapPoints() -%>
<%= cityList = mapPoints.map { |m| [m.description, m.id] }
select("mapPoint", "id", cityList) %>
<%= submit_tag( "Show Map" ) %>
By the Way -
When I hard code the parameter value i.e. @mapPoint = Gmap.find(5),
everything works fine.
2006 Jul 08
1
Need Help Understanding Situation with Table Columns
...39;' AUTO_INCREMENT=6 ;
In the Gmap model I have the following code:
class Gmap < ActiveRecord::Base
require ''pp''
validates_presence_of(:type)
validates_inclusion_of(:type,
:in => 0..4,
:message => "should be a valid abcRealty Map type")
def self.allMapPoints
# Gmap.find(:all,
# :order => "description asc")
results = find_by_sql("select id, description from gmaps WHERE 1")
pp results[0]
pp(Gmap.columns_hash[''type''])
results
end
Note that I cannot get the ''find :all'' statement to work....