Displaying 20 results from an estimated 9000 matches similar to: "Stuck saving Dates as string"
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
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 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 Mar 21
5
Getting a time select input
I''m having trouble workign out which ActionView DateHelpers to display a
time input for an ActiveRecord field of type :time.
I just want an hours input and a minuites input. I can get these with
time_select helper using :field_name and :prefix but it gives both hours
and miniutes the same name.
<%= select_time(Time.now, :prefix => "search", :field_name =>
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 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 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 Apr 15
2
Multi-parameter assignment
Hi,
I''m trying to submit data from text boxes on a form to one variable in
my controller, in the same way that datetime_select has date(1i),
date(2i), etc for day, month, year, etc...
I''ve named my variables event[start_date(1i)] event[start_date(2i)] and
event[start_date(3i)] but this doesn''t seem to work and
event[:start_date] is blank ... any pointers would be
2006 Jul 07
0
datetime/date problems w/ Oracle
I am "script\generate scaffold"ing w/ Oracle. The CRUD controls for DATE
columns in _form.rhtml are generated as datetime_select, rather than
date_select . This is understandable, as Oracle uses a DATETIME data type
for DATE columns. I''m also not too bothered by the fact that I have to
manually replace "datetime_select" w/ "date_select" for all
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 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 Aug 10
1
Convert datetime_select to Time object?
--------------------------
Question 1
--------------------------
I am dealing with a database that holds products and it has a datetime
field called "active_at". so I have the following for active_at:
<%= f.datetime_select :active_at %>
It gives me 5 different params:
params[:product][:active_at(1i)]
params[:product][:active_at(2i)]
params[:product][:active_at(3i)]
2006 Jun 13
17
reconstituting a date
In my view code, I have <%= datetime_select "in_out", "time_in" %>
which returns in params
:in_out: !map:HashWithIndifferentAccess
time_in(1i): "2006"
time_in(2i): "6"
time_in(3i): "12"
time_in(4i): "20"
time_in(5i): "24"
and I want to save that datetime to a column in the db...
if
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
2006 Feb 22
1
specifying m/d/y order in datetime_select
the date_select form helper has a neat little feature which lets you specify
the order of the month/day/year that is displayed on the form via the :order
parameter. i.e.
<%= date_select ''blah'', ''somedate'', :order=>[ :month, :day, :year ] %>
however, i don''t see a similar option for datetime_select. passing
an :order parameter is happily
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 Jan 19
0
file_column error: tmp file created but not actual
Hi
When I submit the form with field_column, the actual
image is not
uploaded, only temp files are crreated and I dont see
actual file created and the image file name is not in
the database and get "fieldWithErrors". Then if
submit again, the actual file in created and an
database record is generated.
Here is the log file. I print @params and @wallpaper.
I find the following:
1st
2006 Apr 20
4
Small Date Formatting Question regarding datetime_select()
Is there a way to make datetime_select() dropdowns work on a 12hr
clock? I need to make a input field that works exactly like the
reminders datetime selecton dropdowns in Backpack to populate a
datetime field in my DB. i.e in the format: month, day, year ? hour
(1-12) minute am/pm. Should I change my database to have a separate
column for date and one for time and use date_select()?
Can
2013 Mar 14
0
[Rails 3.2] accepts_nested_attributes_for and time_select
Hi, I am upgrading a Rails application from Rails 3.1.11 to 3.2.12, but
have a problem with ` accepts_nested_attributes_for` in conjunction with
multipart attributes.
The app is used to manage oral exams, so there is a model `Exam`, which has
many `Examdate`s. When creating an exam, I can also create the examdates,
consisting of a date, a start time and an end time. While the date field is