Fredrik TiC Jansson
2010-Nov-15 09:27 UTC
Using geokit-rails3 and getting Unknown key(s): bounds
Hello posted this question in the Geokit group but there seems to be very little activity in that forum som i will try here instead. No on to my little problem class IntrestPoint < ActiveRecord::Base acts_as_mappable :default_units => :kilometers, :lat_column_name => :lattitude, :lng_column_name => :longitude, :auto_geocode => {:field => :address, :error => ''could not geocode adress''} end i have set up a class like this, now if i enter an adress in my rails app it gets correctly geocoded into long and lat so far so god. But when i try to query for a certain bounds like this def get_intrest_points_within_bounds @sw_point__=params[:sw_point] @ne_point_ =params[:ne_point] @intrest_point IntrestPoint.find(:all,:bounds=>[:sw_point_,:ne_point_]) respond_to do |format| format.html format.xml {render :xml => @intrest_point} format.json {render :json => @intrest_point} end end all i get is an ActionController Exeption Unknown key(s): bounds all my parameters in the url seem to be fine {"get_intrest_points_within_bounds"=>"get_intrest_points_within_bounds", "ne_point"=>"59.759162, 16.777496", "sw_point"=>"59.470199, 16.338043"} the same goes for :within so im guessing something is not included the way it should be which brings me to my next question i have seen some tutorials state that you should have the line include Geokit::Mappable but where do i put this line ? or is it something that is deprecated since rails3 ?( my best guess is that the include should be in my IntrestPoint model but act_as_mappable and reverse geocoding seems to work even if i dont put include anywhere) totally new to the web world here so mabey i am missing something really simple (i am a c/c++ programmer mainly with some obj-c latley) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.