On Lunes, 7 de Marzo de 2011 22:47:52 Lindsay Morris escribió:
> I have a virtual column defined in my helper:
> 
>  def summary_duration_column(record)
>     distance_of_time_in_hours_and_minutes(record.end_time.to_datetime,
> record.start_time.to_datetime)
>  end
> 
> And that displays the duration of the event.  Good.
> 
> I can successfully add it as a search column in the controller:
>     config.columns[:summary_duration].search_sql =
> '(unix_timestamp(end_time) - unix_timestamp(start_time))'
> 
> And it appears in the Search UI box.  Good.
> 
> But the Search UI only shows "Duration:" and a text-input box.
> All the other fields have "Fieldname", and an operators drop-down with
> "Begins with", or "Between", or "=", or ">=", etc.
> I guess AS has to know the type of the field in order to intelligently
> render the operators drop-down.
> Since my field is calculated, it can't guess.
> 
> How do I tell it that the virtual field is numeric?

set search_ui to :integer

-- 
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