Hi everyone,
I''m trying to do this with my view:
|<%= select_year(Time.now, { :start_year => @series.year1 }) %>
For some reason, I''m getting this error:
||undefined method `>'' for false:FalseClass
Does anyone know how to properly set the :start_year value from a variable?
Thanks,
-Jason
|
Mando Escamilla
2005-Sep-20 04:25 UTC
Re: Setting :start_year for select_year with variable
Try it without the {}:
<%= select_year(Time.now, :start_year => @series.year1) %>
--
Mando
On 9/19/05, Jason Gilstrap
<info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org>
wrote:>
> Hi everyone,
>
> I''m trying to do this with my view:
>
> |<%= select_year(Time.now, { :start_year => @series.year1 }) %>
>
> For some reason, I''m getting this error:
>
> ||undefined method `>'' for false:FalseClass
>
> Does anyone know how to properly set the :start_year value from a
> variable?
>
> Thanks,
>
> -Jason
> |
>
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Jason Gilstrap
2005-Sep-20 04:49 UTC
Re: Setting :start_year for select_year with variable
I''ve tried that but I get the same error. Mando Escamilla wrote:> Try it without the {}: > > <%= select_year(Time.now, :start_year => @series.year1) %> > > -- > Mando > > On 9/19/05, *Jason Gilstrap* < info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org > <mailto:info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org>> wrote: > > Hi everyone, > > I''m trying to do this with my view: > > |<%= select_year(Time.now, { :start_year => @series.year1 }) %> > > For some reason, I''m getting this error: > > ||undefined method `>'' for false:FalseClass > > Does anyone know how to properly set the :start_year value from a > variable? > > Thanks, > > -Jason > | > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
Ezra Zygmuntowicz
2005-Sep-20 05:00 UTC
Re: Setting :start_year for select_year with variable
Maybe try this:>> <%= select_year(Time.now, { :start_year => "#{@series.year1}" }) %HTH -Ezra On Sep 19, 2005, at 9:49 PM, Jason Gilstrap wrote:> I''ve tried that but I get the same error. > > Mando Escamilla wrote: > > >> Try it without the {}: >> >> <%= select_year(Time.now, :start_year => @series.year1) %> >> >> -- >> Mando >> >> On 9/19/05, *Jason Gilstrap* < info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org >> <mailto:info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org>> wrote: >> >> Hi everyone, >> >> I''m trying to do this with my view: >> >> |<%= select_year(Time.now, { :start_year => @series.year1 }) %> >> >> For some reason, I''m getting this error: >> >> ||undefined method `>'' for false:FalseClass >> >> Does anyone know how to properly set the :start_year value from a >> variable? >> >> Thanks, >> >> -Jason >> | >> >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> --------------------------------------------------------------------- >> --- >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732
Jason Gilstrap
2005-Sep-20 12:13 UTC
Re: Setting :start_year for select_year with variable
Thanks for the suggestion, but that does not work either. Ezra Zygmuntowicz wrote:> Maybe try this: > >>> <%= select_year(Time.now, { :start_year => "#{@series.year1}" }) % >> > > > HTH > -Ezra > > On Sep 19, 2005, at 9:49 PM, Jason Gilstrap wrote: > >> I''ve tried that but I get the same error. >> >> Mando Escamilla wrote: >> >> >>> Try it without the {}: >>> >>> <%= select_year(Time.now, :start_year => @series.year1) %> >>> >>> -- >>> Mando >>> >>> On 9/19/05, *Jason Gilstrap* < info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org >>> <mailto:info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org>> wrote: >>> >>> Hi everyone, >>> >>> I''m trying to do this with my view: >>> >>> |<%= select_year(Time.now, { :start_year => @series.year1 }) %> >>> >>> For some reason, I''m getting this error: >>> >>> ||undefined method `>'' for false:FalseClass >>> >>> Does anyone know how to properly set the :start_year value from a >>> variable? >>> >>> Thanks, >>> >>> -Jason >>> | >>> >>> >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> --------------------------------------------------------------------- >>> --- >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > -Ezra Zygmuntowicz > WebMaster > Yakima Herald-Republic Newspaper > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > 509-577-7732 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Dave Silvester
2005-Sep-20 12:24 UTC
Re: Setting :start_year for select_year with variable
On Tuesday 20 Sep 2005 13:13, Jason Gilstrap wrote:> Thanks for the suggestion, but that does not work either.Can you post the output you get from putting the following in your template? <%= debug(@series) %> ~Dave -- Dave Silvester Rent-A-Monkey Website Development Web: http://www.rentamonkey.com/
Jason Gilstrap
2005-Sep-20 12:57 UTC
Re: Setting :start_year for select_year with variable
--- !ruby/object:Series
attributes:
name: "Average Establishment Size, Community Care Facilities for the
Elderly"
year1: "1991"
year2: "2004"
units: Number of Employees per Establishment
source_url: "http://www.bls.gov/cew/home.htm\r"
id: "266"
description: "Corresponds to NAICS industry code 6233, Data reflects only
firms with
employees."
source: "U.S. Department of Labor, Bureau of Labor Statistics, Quarterly
Census of
Employment and Wages"
Dave Silvester wrote:
>On Tuesday 20 Sep 2005 13:13, Jason Gilstrap wrote:
>
>
>>Thanks for the suggestion, but that does not work either.
>>
>>
>
>Can you post the output you get from putting the following in your template?
>
><%= debug(@series) %>
>
>~Dave
>
>
>
I had this the other day.
IIRC it''s expecting
1991
not
"1991"
Try
<%= select_year(Time.now, { :start_year => @series.year1.to_i }) %>
On 20/09/05, Jason Gilstrap
<info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org>
wrote:> --- !ruby/object:Series
> attributes:
> name: "Average Establishment Size, Community Care Facilities for the
Elderly"
> year1: "1991"
> year2: "2004"
> units: Number of Employees per Establishment
> source_url: "http://www.bls.gov/cew/home.htm\r"
> id: "266"
> description: "Corresponds to NAICS industry code 6233, Data reflects
only firms with
> employees."
> source: "U.S. Department of Labor, Bureau of Labor Statistics,
Quarterly Census of
> Employment and Wages"
>
>
>
>
> Dave Silvester wrote:
>
> >On Tuesday 20 Sep 2005 13:13, Jason Gilstrap wrote:
> >
> >
> >>Thanks for the suggestion, but that does not work either.
> >>
> >>
> >
> >Can you post the output you get from putting the following in your
template?
> >
> ><%= debug(@series) %>
> >
> >~Dave
> >
> >
> >
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
http://www.snowblink.co.uk/
Jason Gilstrap
2005-Sep-20 15:05 UTC
Re: Setting :start_year for select_year with variable
Jon, That did it. Thanks so much! -Jason Jon Lim wrote:>I had this the other day. > >IIRC it''s expecting >1991 >not >"1991" > >Try ><%= select_year(Time.now, { :start_year => @series.year1.to_i }) %> > >On 20/09/05, Jason Gilstrap <info-Yf9cRGTgqmECWBydzj52wkEOCMrvLtNR@public.gmane.org> wrote: > > >>--- !ruby/object:Series >>attributes: >> name: "Average Establishment Size, Community Care Facilities for the Elderly" >> year1: "1991" >> year2: "2004" >> units: Number of Employees per Establishment >> source_url: "http://www.bls.gov/cew/home.htm\r" >> id: "266" >> description: "Corresponds to NAICS industry code 6233, Data reflects only firms with >> employees." >> source: "U.S. Department of Labor, Bureau of Labor Statistics, Quarterly Census of >> Employment and Wages" >> >> >> >> >>Dave Silvester wrote: >> >> >> >>>On Tuesday 20 Sep 2005 13:13, Jason Gilstrap wrote: >>> >>> >>> >>> >>>>Thanks for the suggestion, but that does not work either. >>>> >>>> >>>> >>>> >>>Can you post the output you get from putting the following in your template? >>> >>><%= debug(@series) %> >>> >>>~Dave >>> >>> >>> >>> >>> >>_______________________________________________ >>Rails mailing list >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> > > > >