Displaying 6 results from an estimated 6 matches for "written_on".
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/.
--~--~---------~--~----~------------~-------~--~----~
You received this mess...
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 the days from 1 to 31, but it is
not right in c...
2012 Jul 18
5
Any comment on adding #cast and #cast! to ActiveRecord::Relation?
...a sql string wherever it''s used.
Here''s an example of where I''d use this:
class Topic < ActiveRecord::Base
has_many :replies
scope :by_most_recently_replied, joins(:replies).group(''topics.id'')
.select(''topics.*, MAX(replies_topics.written_on) AS
latest_reply_written_on'')
.order(''latest_reply_written_on
DESC'').cast(latest_reply_written_on: :datetime)end
>> topic = Topic.by_most_recently_replied.first>> topic.latest_reply_written_on.class=> Time
The cast is applied to postgres columns only...
2009 Jun 16
0
Prompt option not available in rails date helper
Hi prompt option is not available in rails 2.2.but in api.rubyonrails it
hazs mentioned it is there.But its not working.
date_select("post", "written_on", :prompt=>{:day=>''Select day'',
:month=>''Select month'', :year=>''Select year''})
Please give some idea
--
Posted via http://www.ruby-forum.com/.
Overriding date_select in local project to use custom value rather than blank for starting option...
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a
behavior similar to what you get using date_select with the
:include_blank => true option where the first value in the dropdown is
"- Month -", "- Day -", or "- Year -" rather than a blank value for
the respective month, day, and year select fields.
I took a look at the ruby source for
2005 Sep 13
5
acts_as_taggable 1.0.4 now gemified!
Hi Folks,
The acts_as_taggable mixin is now available as a shiny gem.
More details here:
http://dema.ruby.com.br/articles/2005/09/13/acts-as-taggable-gemified
This release features some cool additions as well.
Cheers
Dema
--
http://dema.ruby.com.br - Rails from a .NET perspective