Displaying 20 results from an estimated 50000 matches similar to: "Setting AR attribute from date_select values?"
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
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 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 Mar 15
1
Strange behaviour of dates
Imagine a crud app that tracks people applying for a loan, here is the
layout I have:
Mysql database:
create table apps (
id int auto_increment primary key,
primary_id int not null,
secondary_id int null,
constraint fk_primary_id foreign key(primary_id) references (contacts.id),
constraint fk_secondary_id foreign key(secondary_id) references
(contacts.id))
create table contacts (
Id int
2008 Jun 17
0
how to set tabindex in date_select
<%= date_select(''user'', ''birthdate'', { :start_year =>
80.years.ago.year, :end_year => 12.years.ago.year } ) %>
work in rails 1.2.2
date_select(object_name, method, options = {})
I try many times but also didn''t know how to set tabindex in date_select
--~--~---------~--~----~------------~-------~--~----~
You received this message
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" =>
2008 Jun 26
2
Problem with date_select after Rails 2.1 upgrade
Folks,
I think I should start a new thread for this, because a similar one I
saw is a bit old and the resolution there doesn''t seem to apply to
what I''m running into now.
Anyway, my date_select calls are bombing on me with the exception:
----
ActionView::TemplateError (wrong number of arguments (3 for 2)) on
line #8 of entries/_dates_form.haml:
8: = date_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>
2006 Apr 10
1
Bizzare Date, DateTime, date_select issues
I''ve been banging my head against this wall for several hours, and it
hurts now so I''ll stop and ask someone.
In one of my forms I had been using a statement to extract the current
year for use with some form field calculations.
<% currentyear = DateTime.now.year %>
And then further down several date_selects like the following,
<%= date_select
2007 Apr 14
1
how to add class to date_select helper
Hi,
I have this helper and would like to add a html class to each of the
select box''s it generates, however I have been unable to find a way?
<%= f.date_select ''date_of_birth'', :order => [:day,:month,:year],
:start_year => 1940, :end_year => Time.now.year, :include_blank => true
%>
Any suggestions?
thanks
john
--
Posted via
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
2005 May 31
2
Form Dates and MultiparameterAssignmentErrors
I''m using the date_select form helper for a date_of_birth field on an
ActiveRecord object. When I try to save a date earlier than 1 Jan 1970,
ActionController punts with
ActiveRecord::MultiparameterAssignmentErrors. The message it gives is
"1 error(s) on assignment of multiparameter attributes". I was able to
catch the exception and look at it, and it is certainly complaining
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 Jun 13
0
Get / Set date_select values before form submit
Hi, i''m working with a date_select field, and I''ve got the following
question.
The date_select outputs something that looks like:
<select name="widget[designedon(1i)]">
<option value="2001">2001</option>
</select>
I''m used to using prototype to access form elements, but I seem to be
missing something here.
I''m
2006 Sep 15
1
In datetime_select, :order does not work, but it works for date_select Why
Hi All
In my project I am to take date of birth from user so I used
datetime_select. It renders three selection boxes, year, month and day. But
I want order as day, month and year. I added :order option for
datetime_select, it renders normal selection boxes with order year, month
and day. Why :order does not work with datetime_select? see my following
code
<%= datetime_select(:user2,
2006 Jul 26
1
Plz answer my query in date_select
hello gentlemen
I want to set my (default)own date in date_select, how to do this, plz
explain with example
advance thx
have a nice day
regards
narayana
--
Posted via http://www.ruby-forum.com/.
2008 Feb 24
3
1 error(s) on assignment of multiparameter attributes
I am trying to create a form for processing credit cards. For the
credit card expiration date, I would like to leave the day field out
of the form for obvious reasons. However, the following code is
producing an error for me.
Any ideas?
Thanks!
<p><label for="email">Expiration</label><br/>
<input type="hidden" id="user_card_expiration_3i"
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 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 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/.