On Miércoles, 23 de Junio de 2010 10:36:29 Andrey Voronkov escribió:
> How can I set this options in controller correctly to forget the helper
> method? like this?
> config.columns[:base_price_date].options = {{:start_year => 1990},
> {:end_year => lambda{ Time.now.year }}}
config.columns[:base_price_date].options = {:start_year => 1990, :discard_month
=> true}
And with a before_filter set :end_year, but you will have to set the
before_filter in BuildingObjectsController and change
ObjectCardsController.active_scaffold_config so it works in subform:
def set_end_year
ObjectCardsController.active_scaffold_config.columns[:base_price_date].options[:end_year]
= Time.now.year
end
>
> 2010/6/23 Sergio Cambra .:: entreCables S.L. ::. <[email protected]>
>
> > options.merge(:start_year => 1990,
> >
> > :end_year => Time.now.year, :discard_month => true)
--
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.