similar to: Get / Set date_select values before form submit

Displaying 20 results from an estimated 3000 matches similar to: "Get / Set date_select values before form submit"

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 May 09
0
Problem with date_select
Dates defined chosen with date_select are not coming through once the form is submitted. I have this in a form: <%= date_select ''search'', ''date_start'', :include_blank => true %> <%= date_select ''search'', ''date_end'' , :include_blank => true %> However, when I submit the form params[:search][:date_start]
2005 Sep 16
0
Specify attributes for 'date_select' select inputs
Hi, I could not find an easy way to specify the ''id'' attribute for select inputs of ''date_select'' form helper. I need to set it because I want to retrieve date selects values from a javascript. <%= date_select ''product'', ''expiration'' %> generates <select name="product[expiration(1i)]">
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 Jun 13
0
date_select and date validation
Hi, I''ve put together a simple form that contains among other things a date_select: <%= date_select(:user, :dob, :order => [:day, :month, :year], :start_year => 1900, :end_year => Date.today.year) %> In my controller I have some code to create a user entity from the parameters posted up from the form, like so: parameters:
2006 Feb 18
0
indexed date_select
Hi All, I am wondering if it is possible to have date_select fields that are indexed for updating of multiple rows. Here is my code: <% @book.awards.each do |@award| %> <tr> <td><%= select("award[]", "category", [ "Fiction", "Non-Fiction", "Poetry", "First-Boak", "Translation" ], { :include_blank
2006 Jan 06
0
date_select and sessions
i am using date_select to allow someone to select their birthdate in a form. however date_select uses 3 wierd labels in the forms like follows: <select name="user[birthdate(1i)]"> <option value="1940">1940</option> <option value="1941">1941</option> . and then the month is user[birthdate(2i)] and so on. My issue is i dont know the
2006 Jun 30
0
storing dates from a date_select does not work
Hi there I''m having problems storing dates in a DB(postgreSQL) I have the field dtmfechanac of type date I have this in the view <%= date_select ''usuario'', ''dtmfechanac'', :start_year => 1900 %> and I have this in te controller data = { "dtmfechanac" => params[:usuario][:dtmfechanac] "dtmfechainicio" =>
2006 Feb 04
0
date_select
Can you see an obvious reason why this date_select code is failing? The parameters from the form - *Parameters*: {"commit"=>"Save All Changes", "campaign_id"=>"1", "campaign"=>{"name"=>"fdsfas", "end_date(3i)"=>"26", "start_date(1i)"=>"2006",
2006 Jul 24
1
date_select and ActiveRecord find()
If I pass a date through date_select to a controller, can a Active Record object be found based on this date that is passed? Here is what my log says: ArgumentError (Unknown key(s): publication_date(2i), publication_date(3i), publication_date(1i)): /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/hash/keys.rb:48:in `assert_valid_keys''
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 15
1
Trouble using date_select with blank options
I want to allow users to enter a day and a month, but not necessarily a year. i.e. it should be optional. If I select the day and month, but a blank year and then submit i get: 1 error(s) on assignment of multiparameter attributes The paramaters regarding the date look like this: {"date_of_birth(2i)"=>"3",
2006 Jul 06
3
Understanding date_select naming conventions
I am using the date_select helper to generate date select elements in a form. I notice that the generated HTML shows that these selects have the following names: Month: current_job[StartDate(2i)] Day: current_job[StartDate(3i)] Year: current_job[StartDate(1i)] I''m assuming that the Xi identifiers somehow specify the appropriate date part from a date or time value. Can anyone
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 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 Oct 20
3
Missing id on date_select (0.14.1)
I''m getting markup violation errors on my tests and I noticed that a template with this (a modified 0.13.1 generated scaffold). <label for="credit_card_account">Account</label> <%= text_field ''credit_card'', ''account'' %> <label for="credit_card_expires_on">Expires on</label>
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
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 Aug 14
0
date_select form
How can I define a desired date in the ActionHelper "date_select". I want to select always the last date in the current month. Select: ------- June -> 2006-06-30 July -> 2006-06-31 and so on.... -- Posted via http://www.ruby-forum.com/.
2011 Jul 19
0
Problem with nested form using collection_select and date_select
Hello people I have a table named Items. Items belongs_to inventory, and Items belongs_to product. so items looks like Item -id -inventory_id -product_id -date -comments The main idea is that I want to create an item while I''m creating the inventory by using nested form in the inventory form (I already test creating item with its own methods and forms and works fine), and I get an