Displaying 20 results from an estimated 100 matches similar to: "Cannot save Date field"
2008 Feb 12
4
Funny behavior with Fixtures... on Ubuntu..
Hey Guys,
I''ve got a test class that loads a bunch of fixtures. My understanding
is that fixtures are reloaded between each test... and I even have the
following two method calls at the top of my test class to make doubly
sure...
class TaskTest < Test::Unit::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
When I run my tests
2008 Feb 15
3
Ugly, garbled output from autotest
I am getting this horribly ugly output from autotest when a test fails.
Normal output from ''rake test'':
--
1) Failure:
test_export_format(TaskTest) [./test/unit/task_test.rb:61]:
<"Michael Alvarez"> expected but was
<nil>.
--
Same failure, as seen via autotest:
--
1) Failure:
test_export_format(TaskTest) [./test/unit/task_test.rb:61]:
---
2008 Oct 11
1
Re: time_ago_in_words is off by a day
Look at your 1.day.from_now and see if it''s like this:
Sun, 12 Oct 2008 02:45:42 UTC +00:00
If you also have the "UTC +00:00", it means that you timezone is the
GMT (and I think that it isn''t your real timezone). For example, my
timezone is 3 hours after the GMT, so the right timezone would be
something like this:
Sat Oct 11 23:48:41 -0300 2008
At your
2006 Feb 15
2
Polymorphic joins work one way, but not the other
I''ve been using polymorphic joins from edge rails based on about 5 lines
of advice Rick Olson gave me over IRC. There''s some sparse documentation
popping up but it seems to cover a somewhat different case.
Anyway - I pretty much got it to work - save for one detail. Here''s what
I have:
class Event < ActiveRecord::Base
belongs_to :attachable, :polymorphic =>
2006 Feb 10
14
dynarch calendar and calendar helper usage
I am playing around with this and reference this wiki from RonR site...
http://wiki.rubyonrails.org/rails/pages/CalendarHelper
The error I am getting is:
NameError in Placements#list
undefined local variable or method `date_format'' for
#<PlacementsController:0xb78f9ef4>
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
2006 Mar 21
2
Capistrano: creating your own tasks
When I create a task within capistrano.rb I can call it using rake.
When I create a task and put it in deploy.rb I can call it. Neither
with or without the remote: namespace.
Anyone have any insight into why it does not work?
John Kopanas
2006 Jul 06
6
Help with overriding / overwriting date values in ActiveRecord to accept Euro Style Date from a Textbox
Hi guys,
I''m trying to make an AR model which accepts a string data (from a
text input) in euro date format
eg
<input .... value = "23/01/2006"> ( 23 Jan 2006)
Reading the example from RDoc... i tried to
overwrite/overload/override the = function to write in the date..
Cant get it to work because .. i dont knoe what format should it
accept.. i''ve tried
2006 Mar 23
5
validates_dateness_of ?
Hello all.
I don''t suppose some enterprising soul with much more skill than me has
whipped up a "validates_dateness_of" (Complete with leap year
calculations) method for use with all the other validation methods and
wishes to spread much much joy?
Cheers
Jeff "I can barely code RoR and rely on others to do the hard work"
Jones
--
Posted via
2006 May 16
4
Date/Time Quick Add
I am building a small app that reuires some clever text pattern
matching...
In my controller, I''ll have a string that I will want to parse out to a
datetime and a message, a la Google Calendar Quick Add.
Examples:
10/30/2006 7pm message
10-30-96 7:00 pm message
10/30/2006 19:00pm message
...
You see what I''m getting at. For a v1.0 release, I CAN publish some
standards for
2006 Jun 15
4
parse only seem to understand US date format
I''ve tried Time.parse() and DateTime.parse() but they interpret the date
as US format. Is there any way to tell it to interpret as dd/mm/yyyy?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 09
6
Validating a DateTime
Hi,
Does anyone know of a method to validate a DateTime field?
I''ve looked at the validation docs and the validates_date /
validates_time plug-in but I can''t find a method to validate a value in
the format of yyyymmddhhmm. It seems like something that should exist
already, so I''d just like to check before I attempt my own version...
Cheers,
Mark
2006 Jul 31
1
validate date field
hi,
Below is an example of a text field I have, which works fine, until you
enter an invalid date such as Feb 31st, which doesn''t exist
Is there a way of checking this easily and returning an error message
like validates_presence_of does ?
<p><label for="project_client_deadline_date">Client Deadline
Date:</label><br/>
<%= date_select
2006 May 11
4
string to date/time?
Hey All,
Anyone know of a library for parsing "human" dates, like "this friday"
or "2 days ago"? I used to use strtotime in php, but starting from
here;
http://wiki.rubyonrails.com/rails/pages/PhpStrtotime
and doing lots of googling, I haven''t been able to find anything
similar for ruby. I know of javascript solutions to this, but I''d
need to do
2007 Aug 12
4
Date and Time validator, updater
Can someone point me to a date/time validator or updater.
I have an event start datetime and an event end datetime. I want
to validate that the end datetime is after the start datetime.
Figure there is some code or library out there already, if you
know one, please forward it.
Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2006 Jun 05
5
Regexp - date validation
Can somebody tell me why the following RegExp doesn''t work for date
validation in Rails... It validates fine in RadRails -- using REgExp
panel. Intended format: (mm/dd/yyyy):
%r{^(0[1-9]|1[012])(-|/)(0[1-9]|[12][0-9]|3[01])(-|/)(19|20)([0-9][0-9])$}
If i try the following, it works in Rails:
%r{(0[1-9]|1[012])(-|/)(0[1-9]|[12][0-9]|3[01])}
When I add the last piece, it
2006 Jun 22
4
Filter on variable
Hi all,
I have a question about filtering on a variable.
If I have the following code in my controller to select a list of
users
> @allusers = User.find(:all,
> :conditions => [''team_id = ?'', @params["id"],
> :order => ''created_at'')
Is there an easy way to find out all users who
2006 May 16
9
Date transform
hi all,
i want my users to enter a date in "ddmmyyyy" format, do someone know
how may i transform it in "yyyy-mm-dd" in the controler before i add it
to the base please?
thks
irong
--
Posted via http://www.ruby-forum.com/.
2009 May 19
0
submit_to_remote fails on rails 2.2.2
submit_to_remote fails on rails 2.2.2 and rails 2.3.2 but fully
working with 2.0.2
please give me an answer as soon as possible. its very urgent
the code is
HTML
====
<% form_for :todo, @todo, :url => { :action => "update_todo" } do |f|
%>
<div>
<p>
<label>Todo</label>
<%=f.text_field :name%>
</p>
<p>
2006 Mar 10
19
validates_date plugin for ActiveRecord
This plugin gives ActiveRecord the ability to do stricter date checking.
Example:
class Person < ActiveRecord::Base
validates_date :date_of_birth
end
This will ensure that date_of_birth is a *valid* date. The date can be set
initially as a string in any of the following formats:
"2006-01-01"
"1 Jan 06", or "1 Jan 2006"
"1/1/06" # Day /
2008 Apr 16
8
Will acts_as_taggable_on_steroids and better_nested_set work together?
I am having this crazy problem where it ONLY shows up in testing.
This is my test code
<code>
def test_should_destroy
task1 = Task.new(:description => "tmp",
:done => false,
:user => User.find_by_login(''admin''))
assert task1.save
assert task1.destroy
end
</code>
This is my task model