Article View: pl.comp.lang.ruby
Article #576Re: date_select - jak pobrać datę?
From: sebastian.nowak
Date: Mon, 03 Sep 2007 09:50
Date: Mon, 03 Sep 2007 09:50
26 lines
1862 bytes
1862 bytes
On 2 Wrz, 11:06, Piotr Czeszkiewicz <piotr.czeszkiew...@gmail.com>
wrote:
> Witam,
>
> Mam w widoku
>
> = date_select :zal, :created, :start_year => Time.now.year - 2
>
> Jak w controllerze wydobyć z tego datę w formacie '0000-00-00'?
>
> params[:zal] daje taki format:
>
> created(1i)2007created(2i)9created(3i)2
>
> Pomocy.
>
> --
> czeslavv
Może nie do końca rozumiem co masz na myśli, ale ...
1. Czemu :created a nie :created_at? Nie wiem jak :created
ale :created_at jest automatycznie uzupełniana, nie musisz o tym
pamiętać.
2. Wkleję kawałek z console:
>> Site.find(1).created_at.strftime("%Y-%m-%d")
=> "2007-08-24"
O taką datę Ci chodziło?
Technical Details
Message-ID:
<1188813027.890427.128270@g4g2000hsf.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!g4g2000hsf.googlegroups.com!not-for-mailReferences:
<fbdund$kjv$1@nemesis.news.tpi.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!g4g2000hsf.googlegroups.com!not-for-mail From: sebastian.nowak@gmail.com Newsgroups: pl.comp.lang.ruby Subject: Re: date_select - jak pobrać datę? Date: Mon, 03 Sep 2007 09:50:27 -0000 Organization: http://groups.google.com Lines: 27 Message-ID: <1188813027.890427.128270@g4g2000hsf.googlegroups.com> References: <fbdund$kjv$1@nemesis.news.tpi.pl> NNTP-Posting-Host: 89.230.130.179 Mime-Version: 1.0 X-Trace: posting.google.com 1188813028 29278 127.0.0.1 (3 Sep 2007 09:50:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 3 Sep 2007 09:50:28 +0000 (UTC) In-Reply-To: <fbdund$kjv$1@nemesis.news.tpi.pl> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20061201 Firefox/2.0.0.3 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g4g2000hsf.googlegroups.com; posting-host=89.230.130.179; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit