Displaying 20 results from an estimated 500 matches similar to: "Using a helper within another helper?"
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
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(
2008 Jul 04
4
select_datetime // datetime_select
Hi I have 2 question for you guys,
1. Which is the difference between this two methods? (select_datetime,
datetime_select)
2. How I assign the selected date-time values, to an specific variable
or array using select_datetime
I know do it using datetime_select(''object'',''method'')
I aprecciate your attention.
Thanks
PD: Sorry about my english.
2008 Jun 09
3
Rails 2.1 and ddatetime_select
I''ve updated to 2.1 and am continuing to have issues with
datetime_select helpers which worked fine previously.
Example:
<% form_remote_tag(:url => { :controller => ''notes'',
:action
=> :add_booking_note_ajax,
:id => @booking},
2006 Jul 13
3
date_helper megapatch and MultiparameterAssignmentErrors
Hello all,
There''s a great patch in trac that fixes a lof of issues with the
date helpers. I''m afraid it hasn''t had any attention yet.
http://dev.rubyonrails.org/ticket/3811
This fixes all the little date_helper problems, except one: When you
choose an invalid date ActiveRecord throws an
ActiveRecord::MultiparameterAssignmentErrors. This used to work in
1.0,
2005 Dec 01
0
Problem using a date helper
Hi,
I''m having trouble getting a date helper working. I was pointed to
this by Sean Allen, and it resides at
http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes
It''s meant to fix the bug in Rails which doesn''t allow datetime_select
to properly discard the year.
So, I''m trying to use the helper''s time_select function.
date_helper.rb
2008 Feb 03
4
Testing helper/view methods from script/console
Hi,
Is it possible to test helper/view methods from script/console. I want
to test the output of methods like distance_of_time_in_words. But it
won''t let me from the console. What am I missing?
TIA
Luke
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2007 Feb 21
2
date helper bug?
I''ve found an issue when trying to use the time_ago_in_words and
distance_of_time_in_words from action view''s date_helper.rb
Using SQL Server, I have a datetime column that gets returned as:
"2007/02/21 09:54:00". When I pass this to time_ago_in_words (which
just passes on to distance_of_time_in_words) it miscalculates the
difference as "9 hours" (...um yeah,
2006 Mar 10
14
Oracle Date type errors rails on edit
I have a table with "expires_on" a DATE field.
"Show" and "Destroy" work, but "Edit" errors:
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:150:in
`select_hour''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:149:in
`select_hour''
It only happens when
2006 Dec 18
1
Bad merge of r5686 from trunk to 1.2-pre-release?
I do not closely follow the core source commits, but please bare with
me. I will keep it short.
Recently, changeset#5685 [1] caught my attention as I''ve been waiting
for some date_helper love for a VERY long time.
What bothered me is that when this changeset was merged into the 1.2-
pre-release branch (at changeset#5686 [2]) a change to caching.rb
crept in [3], which was not in
2012 May 29
2
Use variable inside Function for updating the matrix
Hi,
Here i have a data frame like this,
frame name is "dat"
*NAME AGE ELIGIBLE*
A 20
B 14
C 35
D 10
E 50
In this, i want to change the column '*ELIGIBLE*' status to '*YES*' If, AGE
between 18 to 35
Which means that, i should get a put like
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 Jan 23
11
mysql dates
does anyone know of a way to make the date_helper deal with mysql dates with 00 values in them?
I have lots of dates that are like the following:
2005-04-00
2005-00-00
and I need to set null values in a date_select for elements that are 00. These are valid dates in mysql.
In the absence of an immediate solution to the above, I''ve been trying to find out how InstanceTag.new works so I can
2013 Sep 27
0
Best and Worst values
Ira,
obj_name<- load("arun.RData")
Pred1<- get(obj_name[1])
Actual1<- get(obj_name[2])
dat2<- data.frame(S1=rep(Pred1[,1],ncol(Pred1)-1),variable=rep(colnames(Pred1)[-1],each=nrow(Pred1)),Predict=unlist(Pred1[,-1],use.names=FALSE),Actual=unlist(Actual1[,-1],use.names=FALSE),stringsAsFactors=FALSE)
dat2New<- dat2[!(is.na(dat2$Predict)|is.na(dat2$Actual)),]
?dat3<-
2011 May 18
1
How to make array of regression objects
Dear all,
I have made couple logistic regressions, what making a distribution of some
event.
Currently, i store it like this:
o1 <- lrm(...)
o2 <- lrm(...)
o3 <- lrm(...)
...
Then, i have made a function to peak required regression object from this
variables by it number:
get_object <- function(obj_name, nModel) {
eval (parse(text=paste("o <- ", obj_name, nModel,
2006 Jun 26
2
DRY up selects in view
Here''s what I''ve got:
<% @fields.each do |field_name| %>
<tr>
<td>
<%= field_name.humanize %>
</td>
<td>
<% unless field_name =~ /_id$/ %>
<%= form.text_field field_name, :size => 40 %>
<% else %>
<%= select(:vendor,
field_name,
State.find(:all, :order
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
2013 Sep 25
1
Best and worst values for each date
Hi,
May be you can try this:
obj_name<- load("arun.RData")
Pred1<- get(obj_name[1])
Actual1<- get(obj_name[2])
library(reshape2)
dat<-cbind(melt(Pred1,id.vars="S1"),value2=melt(Actual1,id.vars="S1")[,3])? # to reshape to long form
colnames(dat)[3:4]<- c("Predict","Actual")
dat$variable<- as.character(dat$variable) #not that
2007 Jul 31
11
helper spec not finding rails core helpers
Hi,
My helper specs were going ok until I added a call to a rails
DateHelper method in one of my helpers
http://api.rubyonrails.com/classes/ActionView/Helpers/
DateHelper.html#M000574
The helper runs fine from my view templates, just dies in the spec test.
I boiled my question down to a simple (not too useful) example. I''m
not sure what I''m missing.
#
2006 Jun 17
0
Dynamic forms containing collections
Hiall,
I have the following problem: I need to use forms containing
collections (i will call them FCC), and I want to construct them
dynamically, as I need to deal with quite large forms (more than 600
input fields).
The variables @model_name and @field_name contain the proper model and
field names as strings, which is enough for "normal" form input
fields. (i.e. the "if