Re: [Rails] Re: date_select -> params ok but nil

2014-11-21 Thread tom
hi thx for all. the reason why i asked is because some code i have used from the internet was checking: params[:event][:from_date].empty? , but mine was always nil (as above). after assigning the params to a new model and checking then fixed it for me. On Thu, Nov 20, 2014 at 11:30 AM, Matt

[Rails] Re: date_select -> params ok but nil

2014-11-20 Thread Matt Jones
On Wednesday, 19 November 2014 17:40:50 UTC-5, der_tom wrote: > > hi, > > im kinda stuck... > > <%= form_for(@event) do |f| %> > > <%= f.label :from_date %> > <%= date_select :event, :from_date %> > > > > . > > def create > p params[:event].nil? > p params[:event][:name] > p par

[Rails] Re: date_select -> params ok but nil

2014-11-20 Thread Mike
You're using the f.label and date_select helpers. Try using f.date_select ? On Wednesday, November 19, 2014 2:40:50 PM UTC-8, der_tom wrote: > > hi, > > im kinda stuck... > > <%= form_for(@event) do |f| %> > > <%= f.label :from_date %> > <%= date_select :event, :from_date %> > > > >

[Rails] Re: date_select always displays current day

2011-11-16 Thread AJ Chen
thanks. that works. -aj On Nov 16, 12:45 pm, Craig White wrote: > On Nov 15, 2011, at 9:08 AM, AJ Chen wrote: > > > In my model, birthday is of type Date. The following date_select field > > always displays the current day in the browser even though :birthday > > has a different value.  Any idea?

[Rails] Re: date_select equivalent for form_tag?

2010-08-23 Thread Sandy
On Aug 23, 10:23 am, Frederick Cheung wrote: > On Aug 23, 2:51 pm, Fritz Trapper wrote: > > > Is there an equivalent for date_select to be used in a form_tag block? > > select_date > > Fred > > > > > -- > > Posted viahttp://www.ruby-forum.com/.- Hide quoted text - > > - Show quoted text - That

[Rails] Re: date_select equivalent for form_tag?

2010-08-23 Thread Frederick Cheung
On Aug 23, 2:51 pm, Fritz Trapper wrote: > Is there an equivalent for date_select to be used in a form_tag block? select_date Fred > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post t

[Rails] Re: date_select Year as a text_field

2010-07-31 Thread Sur Max
Hi, Yes, actually I had an exact requirement a while ago and when I saw you asking for the same thing, I thought it would be better to blog it down so it can be easily accessible for everyone. regards, Sur http://rubyonrailshacks.com http://expressica.com Sur Max wrote: > Hi, > > Seems the

[Rails] Re: date_select Year as a text_field

2010-07-31 Thread Cam
I see it now in Safari. Thanks again. The tutorial was very clear and straight forward. Worked very well. Cam On Jul 31, 2:25 pm, Sur Max wrote: > Hi, > > Seems the color highlighting plugin is broken in Safari. > Please see it in FireFox. > > regards, > Surhttp://rubyonrailshacks.com > > Cam wr

[Rails] Re: date_select Year as a text_field

2010-07-31 Thread Sur Max
Hi, Seems the color highlighting plugin is broken in Safari. Please see it in FireFox. regards, Sur http://rubyonrailshacks.com Cam wrote: > Thanks for your reply and for the tutorial. The code is not showing on > the page though. > http://rubyonrailshacks.com/2010/07/how-to-modify-date_select-

[Rails] Re: date_select Year as a text_field

2010-07-31 Thread Cam
Thanks for your reply and for the tutorial. The code is not showing on the page though. http://rubyonrailshacks.com/2010/07/how-to-modify-date_select-to-show-text-field-for-year/ Cheers, Cam On Jul 31, 12:11 am, Sur Max wrote: > Hi, > > It is simple, but it's not straight forward. > You just n

[Rails] Re: date_select Year as a text_field

2010-07-30 Thread Sur Max
Hi, It is simple, but it's not straight forward. You just need to discard the year from select and add the proper name to the text field for year. You can refer it here for better example with code http://rubyonrailshacks.com/2010/07/how-to-modify-date_select-to-show-text-field-for-year/ regard

[Rails] Re: date_select with Searchlogic

2010-02-27 Thread goodwill
+1, hit this nail right on today :( On Feb 25, 7:27 pm, Stuart Corbishley wrote: > I am aware that date selects params are supposed to supported by > Searchlogic. > > But I'm battling to get them working. > > I am using one of the named_scopes that it makes, and it works perfectly > in the consol

[Rails] Re: date_select

2010-01-29 Thread Smit Shah
Alexis Mueller wrote: > Without knowing more about your app and your models, I would ask what > the :post refers to in your date_select. > > If I understand you correctly, you want to render a date select field > for the 'birthdate' attribute. What model does this attribute belong > to? Are you us

[Rails] Re: date_select

2010-01-28 Thread GreenPlastik
Without knowing more about your app and your models, I would ask what the :post refers to in your date_select. If I understand you correctly, you want to render a date select field for the 'birthdate' attribute. What model does this attribute belong to? Are you using the date_select as part of a f

[Rails] Re: Date_select - Specifying an id for each selector fails

2009-08-08 Thread Frederick Cheung
On Aug 8, 9:41 pm, Lb2007 wrote: > <%= f.date_select :start, {:order => [:day, :month, :year]}, {:id => > {:year => 'abc', :month =>  'de', :day => 'xy'}} %> > The code above nearly works; the right selectors are generated in the > right order, however, the IDs of each selector are the same; sim

[Rails] Re: date_select problem with i18n

2009-07-14 Thread Sylv Gran
Jeba Momin wrote: > Hi, > I'm localizing my rails 2.2.2 application using i18n. > In my form(view) I have: > <%= date_select :range,:start_date,:order => [:month,:day,:year]%> > In environment.rb I have: > I18n.default_locale = 'en-US' > and in en-US.rb its: > I18n.backend.store_translations 'en-U

[Rails] Re: date_select

2009-05-21 Thread Colin Law
I don't know about date and time types. Colin 2009/5/21 Tyler Knappe > > Colin Law wrote: > > 2009/5/21 Tyler Knappe > > > >> > > >> > > > > I may have to be corrected, but I don't think this is necessary. If the > > db > > column is datetime (as defined in the migration and schema.rb) then th

[Rails] Re: date_select

2009-05-21 Thread Tyler Knappe
Colin Law wrote: > 2009/5/21 Tyler Knappe > >> > >> > > I may have to be corrected, but I don't think this is necessary. If the > db > column is datetime (as defined in the migration and schema.rb) then the > value in a DateTime object should be written (and read) automatically in > the > ap

[Rails] Re: date_select

2009-05-21 Thread Colin Law
2009/5/21 Tyler Knappe > > WJSimacek wrote: > > On May 21, 2:28�am, Colin Law wrote: > >> If you save it in the database as a datetime then all should be well. > �If > > > > Have you tried using the :db format?: > > > > Time.now.to_s(:db) # this forces the save to the db in > > comp

[Rails] Re: date_select

2009-05-21 Thread Tyler Knappe
WJSimacek wrote: > On May 21, 2:28�am, Colin Law wrote: >> If you save it in the database as a datetime then all should be well. �If > > Have you tried using the :db format?: > > Time.now.to_s(:db) # this forces the save to the db in > compatable formats > > -- Wayne I'm not sure

[Rails] Re: date_select

2009-05-21 Thread WJSimacek
On May 21, 2:28 am, Colin Law wrote: > If you save it in the database as a datetime then all should be well.  If Have you tried using the :db format?: Time.now.to_s(:db) # this forces the save to the db in compatable formats -- Wayne > that is not possible then you could have

[Rails] Re: date_select

2009-05-21 Thread Colin Law
If you save it in the database as a datetime then all should be well. If that is not possible then you could have a virtual datetime member that you setup in a filter after reading it from the db and this is what goes to the form. You can then put the code converting it back to your homespun form

[Rails] Re: date_select and tabindex

2009-04-21 Thread Dmitry Sokurenko
Use <%= date_select "user", "dob", {:start_year=>1960}, {:tabindex=>"4"} %> But the tabindex will be the same for all 3 comboboxes. Dmitry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

[Rails] Re: date_select and HTML options?

2009-04-12 Thread Jason
Thanks, that worked. Still learning when to hash it up ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubsc

[Rails] Re: date_select and "31st February"

2009-04-04 Thread Jim Burgess
Just thought I'd let you know how things turned out. I have discarded the idea of using date_select as it is full of inconsistencies which in the worst case can cause the application to crash. Instead I created three seperate text fields (DD-MM-)and using virtual attributes in the model ma

[Rails] Re: date_select and "31st February"

2009-04-03 Thread Frederick Cheung
On Apr 3, 4:29 pm, Jim Burgess wrote: > > You can't easily stop the user entering dates like that with rails > > built in date helpers, so you need to rescue those exceptions and > > massage them into a friendly message. > > Hi Fred, > I'm quite surprised, as I would have thought that this make

[Rails] Re: date_select and "31st February"

2009-04-03 Thread Jim Burgess
> You can't easily stop the user entering dates like that with rails > built in date helpers, so you need to rescue those exceptions and > massage them into a friendly message. Hi Fred, I'm quite surprised, as I would have thought that this makes the entire date_select helper open to misuse. Non

[Rails] Re: date_select and "31st February"

2009-04-03 Thread Frederick Cheung
On 3 Apr 2009, at 14:02, Jim Burgess wrote: > > Thanks for the quick reply. > It is important for my form that the date_select helper is not > initialized with a value (ie. :include_blank => true). > So, how could I stop the above error from happening? You can't easily stop the user entering da

[Rails] Re: date_select and "31st February"

2009-04-03 Thread Jim Burgess
Thanks for the quick reply. It is important for my form that the date_select helper is not initialized with a value (ie. :include_blank => true). So, how could I stop the above error from happening? Could you give me a hint as to which direction to be thinking in? I'm still relatively new to Rail

[Rails] Re: date_select and "31st February"

2009-04-03 Thread Frederick Cheung
On 3 Apr 2009, at 13:38, Jim Burgess wrote: > > Hi, > > I'm writing a form where the user should enter their date of birth. > > Here's the code: > > <% form_for :applicant, :url=> {:action => "index"} do |f| %> > ... > <%= f.label :dob, "Date of Birth" %> > <%= f.date_select :dob, :include_blank

[Rails] Re: date_select and HTML options?

2009-03-16 Thread ZebaMomin
Try this <%= f.date_select :expiration_date, {:order => [:month, :year], :discard_day => true},{ :class => "dtfld"} %> On Mar 14, 1:59 am, Jason wrote: > I have the following code, but can't seem to get the class attribute > to show up in the generated select elements. I saw something about a >

[Rails] Re: Date_select vs wrong date weird behavior

2008-11-26 Thread Rick
Remi, Sorry it's taken me so long to get back to you, I lost the thread... I think what you're looking for is the callback from ActiveRecord::Callbacks -- before_save Rick On Nov 1, 4:31 am, Rémi Gagnon <[EMAIL PROTECTED]> wrote: > Let me clarify. > > The date_select help generates 3 combobox,

[Rails] Re: Date_select vs wrong date weird behavior

2008-11-01 Thread Rémi Gagnon
Let me clarify. The date_select help generates 3 combobox, days, months and year. So for a user it is possible the select in days 31 for april, I know its a wrong date that's why I want to nofify the user that he entered a wrong, but when I display the page back whit the error the date has ch

[Rails] Re: Date_select vs wrong date weird behavior

2008-11-01 Thread Rick
I'm not sure about that "should be 31 April" since every April I've ever experienced has only had 30 days. Your first statement "it converts it for 1st may" actually seems to be correct behavior if you're riding on time's arrow. Rick On Oct 31, 5:44 am, Rémi Gagnon <[EMAIL PROTECTED]> wrote: >