On Martes, 11 de Mayo de 2010 12:16:03 gs84 escribió:
> On 11 mai, 11:41, "Sergio Cambra .:: entreCables S.L. ::."
> By using only the conditions_for_collection method, i get an error
> like:
>
> "Mysql::Error: Unknown column 'distance' in 'where clause': SELECT

You can't use only conditions_for_collection method becuase distance is defined 
by geokit, so you have to set :origin option with custom_finder_options

>
> > def custom_finder_options
> >   if session[:usager_id] != nil
> >     commune_usager = Usager.find(session[:usager_id]).commune
> > #city of the current usager
> >     commune_usager_lat = commune_usager.lattitude  #lattitude of
> > current usager's city
> >     commune_usager_long = commune_usager.longitude #longitude of
> > current usager's city
> >
> >     :order => 'distance ASC', :origin => [commune_usager_lat,
> > commune_usager_long]
> >   else
> >     {}
> >   end
> > end
> > --
>
> For the custom_finder_options method, (because i got a syntax error,
> unexpected ',', expecting kEND)
>  i have add "{}" in the  conditions expression  like: { :order =>
> 'distance ASC', :origin => [commune_usager_lat, commune_usager_long] }

I forgot the {}.

>
> here also (when using the two methods), i got error : " Unknown
> key(s): origin "


Please, put backtrace, I need the line number

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.

Reply via email to