search for: date_selects

Displaying 20 results from an estimated 163 matches for "date_selects".

Did you mean: date_select
2005 Feb 15
5
date_select where to add "class"=>"something"
Hi, I''ve looked on api.rubyonrails.org but I''ve not found how to add to a date_select(object, method, options = {}) a class option to set the class of all the select tags. I''ve tried using "class" => "myclass" in thoose ways: <%= date_select("costo", "data", "class" => "testo" ) %> <%=
2006 Jan 19
2
date_select broken
I am using date_select and in some instances it only shows about 10 years worth of choices. Same form on other users shows the whole range. date_select looks like this <%= date_select ''user'',''birthdate'' , :start_year => 1940 %> I would expect to always see 1940-2006 or so , but i dont always do. Is there a way to force the range or explain why i
2006 Jan 07
4
set date with date_select
when retreiving a date from a DATETIME field in a database, is there a way to set the date to the value of the DB in the view? It seems to always default to the current date... if I have a field called birthdate in the users table and i do @user = User.find(@params[:id]) in my view i have a <%= date_select ''birthdate'',''user'' %> but dont know how to
2006 Nov 04
2
date_select parameter
Trying to add start year to date_select <%= date_select(:start_year => 1980)%> It''s throwing an exception "wrong number of arguments (1 for 0) Can''t I add a start_year, API shows this option ? TIA Stuart http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2007 Jun 13
3
date_select css options
Just looked at the Date helper in the rails API and noticed that none of the functions there (i.e. date_select) allow me to specify html options (i.e. class) for the generated selects. I was wondering how do other group members css format date select dropdowns? Best, Gabor --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2010 Jul 31
5
date_select Year as a text_field
Hey all, Using date_select in a form, how can I make the Year field a text_field instead of a select? It looks like it will take more than a simple modification of the date_select method. Thanks in advance. Cam -- 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
2006 Feb 08
6
can''t get date_select to work
Hi, I render a couple of date_select fields, the HTML looks fine, I can see the values submitted back to the server, but AR doesn''t pick them up from the hash in Booking.new(params[''booking'']). I''ve got a ''booking'' object with parameters product, startdate and enddate. HTML snippets: <select
2006 Jul 26
2
text_field and date_select in collection
hello, i would like to display a collection of records on one page (e.g. an author record with all his/her books). a record contains a text_area (e.g. a description of the book) and a date_select (e.g. when the book was published). <% for @book in @author.books %> <%= text_area ''book[]'', ''note'' %> <%= datetime_select
2005 Dec 15
1
date_select help
I''m trying to select items from a database by their date field. The date data is coming from a form using the date_select helper. The field in the database is named date_notified_on. My controller method is this: def history_date if(@params) @notifications = Notification.find(:all, :conditions => ["date_notified_on = ?",
2007 Oct 13
5
default date for date_select
Hi, How can I set a default date for a date_select? I''m trying to do something along the lines of: <%= date_select("requirement", "target_date", :end_year => 2020, :discard_day => true, :include_blank => true, :order => [:month, :year], :default => {:month => 10, :year => 2012 }) %> but the default that comes up on the form is blank month
2006 Feb 28
1
RoR date_select() default date
Hi, I''m trying to use the date_select() function of ruby on rails, but I want my form easier to use and I want to put an explicit default date. I don''t kow how to do that. I can''t find any information about default on the web, and no example either. Let me know if there is a tips that I don''t know... -- Posted via http://www.ruby-forum.com/.
2005 Apr 20
1
default date in date_select?
Hi there, I''m new to Rails -- started with this project just about five days ago -- I''m re-building an in-house ordering tool, and it would be handy to pre-populate a date_select field with a value two weeks from now. The calculation isn''t the hard part, it''s getting date_select to pre-populate itself. Any suggestions? Thanks, --Jim
2009 Mar 13
2
date_select and HTML options?
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 bug/patch. However, as am still learning RoR I didn''t want to jump to conclusions. Anyone see anything wrong: <%= f.date_select :expiration_date, :order => [:month, :year], :discard_day => true, :class => "dtfld" %>
2008 Oct 31
3
Date_select vs wrong date weird behavior
In my date_select if I choose 31 april 2008, it converts it for 1st may 2008 which it seems odd for me? I say odd because first its difficult to validate at the model level, I have to hook some code in the controller and secondly when I finally get the validation errors I have to go back at the edit page and show the selected date(and the error message) which should be 31 april 2008 but the date
2006 Jun 12
2
date_select() in collection
Hi, I am doing the following: <% obj.contracts.each do |@contract| -%> ... <%= hidden_field("contract[]", :contractor_id, :index => @contract.contractor.id) %> <%= date_select("contract[]", :starting_on, :index => @contract.contractor.id) %> ... <% end -%> Here are the request parameters: {"commit"=>"Save",
2006 Feb 28
1
Working with date_select ...
I am a little confused about the best way to work with date_select. I see that in my views it generates a simple input form that allows for the entry of year, month and date information. If I just leave it at that, great! But what if now in the controller, I want to work with the date information. I actually want to take the user input date and compute a new date some number of days in the
2006 Sep 12
1
How to use a text box instead a lis for year in date_select
Hi, I have a date_select in my application and is used to select birth date of authers. So it is quite long list of years in drop down list and seems not practical. I want to have month and date drop downs as it is and to use a text box to enter only the year. Is it possible with date_select? Thank you. Sameera -- Posted via http://www.ruby-forum.com/.
2006 Dec 10
2
set specific date with date_select
Hi All I seem to have a problem with date_select methods. I cannot set a default date. I tried the following: <%= date_select( "post", "written_on", :selected => Date.new(2005,3,31), :order => [:day, :month, :year] ) %> But still I get todays date :( Any suggestions what I do wrong here ? Thnx a lot LuCa -- Posted via http://www.ruby-forum.com/.
2011 Jan 04
1
Problem with "date_select" form helper
Hi, I am using "date_select" form helper to select the date. My code is as follows:- <%=date_select("post", "written_on", :prompt => { :day => ''Select day'', :month => ''Select month''}, :discard_year=>true)%> It works. But there is problem with the number of days for each month. The days combobox has populated with
2007 Dec 26
2
Overriding or changing HTML generated by date_select?
Hi, I''m looking for a way to customize the HTML forms generated by date_select. I''m especially keen on replacing the year and possibly day input by a simple text field, since honestly, I find listboxes for years to be quite retarded (if I wanted client-side validation, there would be better ways to do that instead of having people try and find their year of birth in a list of