Displaying 20 results from an estimated 10000 matches similar to: "newbie: Using text_field for date and select_time for time"
2006 Aug 01
6
Newbie: How to use text_field with Java Script
<input type="text" name="date1" id="dateField1"
onchange="magicDate(''dateField1'');" onfocus="if (this.className !=
''error'') this.select()" />
How could I generate above text filed using ruby?
I am not sure how to give the options such as onchange, onfocus, id and
so on?
could some one please help.
--
2005 Mar 04
0
Time input with select_time
In MySQL I have a table named "game_times" with a time type field named
"begin". I figured it would be straightforward to use "select_time" to
get input in the view:
<%= select_time(Time.now, :prefix => "game_time[begin]") %>
However, in the controller:
@game_time = GameTime.new(@params["game_time"])
Doesn''t seem to work.
2006 Mar 12
3
select_time help needed (Noob)
I can''t seem to get a handle on how the select_time helper is supposed
to work. I''m a complete noob to rails so bear with me please. I''m trying
to add fields to a form to allow for time (hh:mm) selection ie. call
received, enroute, etc.. I don''t understand how one maps the form data
to the table object and field ie. calls table recieved field.
2006 Jan 20
2
select_time issue: how to get hours only upto 12 along with AM/PM
My code is like this:
<%= select_time () %>
1) I would like to pass more options so that the a blank value is at the
top. I tried ":include_blank => true" but it didn''t work.
2) I would like to limit the number of hours to only upto 12. With the
current code the hours has value rangin from ''00'' to ''23''
3) Would like to have
2007 Jan 23
0
Styling select_time
select_time, select_hour & select_minute all seem to ignore the :class
option. Is there a way to apply a CSS class to these fields?
Stephen Gerstacker
Sr. Database Developer
Electronic Data Payment Systems
p: 866.578.9740 x114
f: 866.578.9740
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Mar 06
2
form_tag error -- not found, 404 -- action DOES exist!
Hi -- I''ve got a very strange error.
I have an action called ''commit_input'' on a controller called
''SiteVisitController''. This definately exists, and is called from the
functional test for it, and passes fine.
My problem is with the form that is supposed to call this action.
The form tag is:
<%=
2006 Sep 25
0
Newbie: Proper way to set default text_field form value ?
I''m using the _form.rhtml partial for both the new.rhtml and edit.rhtml
views like this:
<% if @product.cost %>
<%= text_field ''product'', ''cost'', :size => 5 %>
<% else %>
<%= text_field ''product'', ''cost'', :size => 5, :value => 0 %>
<% end %>
I couldn''t find a
2006 Jul 10
2
Formatting of dates in a text_field
When displaying a date field using a text_field object, is it possible
to specify how the date will be formatted?
<%= text_field ''item'', ''created_at'', {:class=>"text-input", :size=>18,
:disabled=> true}
produces
2006-07-07 12:00:00
I would like to reformat it to something like
07/07/2006 12:00pm
--
Posted via
2008 May 13
2
How to set the current date to a text_field
Hi!
I''m new to Rails, and I have an app which uses text_fields. How can I
set the default value to the current date? I''m using Rails 2.
thanks!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2006 Jul 26
4
How to Install Engines?
I am trying to get this enginer to work....and I am not sure how to
install the engine? could someone please give me some instructions with
regards to this....
http://rails-engines.org/wiki/pages/DateboxEngine
for example in the website above
The Engines plugin or the EdgeEngines plugin
* Engines 1.0
script/plugin install
http://opensvn.csie.org/rails_engines/branches/engines/
*
2006 Apr 08
1
text_field behaviour with validations
Hi,
The text_field method sets the class of the field to "invalid" when the object
you specified is invalid (when using validations). This is to facilitate
working with validations.
Is there anything else it does? In a certain non-standard situation I''m forced
to use text_field_tag, instead of text_field. This means I have to take care
of the validations myself as well.
2007 Sep 18
2
Setting default value in text_field/password_field
I am trying to set a default value in a text_field form. I know how
to do this in html, but is there a way to do
this with form_for
Here is my code
<% form_for :user do |f| -%>
<p><label for="firstname"%>First Name</label><br/>
<%= f.text_field :firstname%></p>
...
<p><label for ="email"%>Email</label><br/>
2006 Feb 24
2
Formatting values of numbers using text_field
Anyone have a quick solution on how to format a number in a text_field
tag?
<% text_field "price", "amount" %> returns 100.0 and it would be nice
if it showed 100.00
Of course, number_with_precision works nicely, but how do you make that
work with text_field?
I thought maybe overriding the getter in the model. However, this means
I would have to bring the helper
2006 Apr 18
1
''wrong number of arguments'' for text_field?
This is probably something very simple but I can''t seem to figure out
why I keep getting the ''wrong number of arguments (1 for 2)'' error with
the following code when I try to create a new record. If anyone can see
what is going wrong here please help!
new.rhtml
-------------------------------------------------
...
<%= start_form_tag :action =>
2006 Jan 14
2
link_to_remote and an id that points to a text_field
Hi!
I''m having trouble with the following thing:
I have a view with a text_field. What I want is to call a remote method
with the value of the text_field as the :id I supply to link_to_remote.
How do I do this?
It''s about an empty form, so the text_field doesn''t have a value when
the page is loaded.
Grtz,
Wouter
--
Posted via http://www.ruby-forum.com/.
2005 Jul 22
1
A Bit Baffled By text_field
Hello.
I am converting my Java app to Rails and I''ve hit something that has me a
bit baffled. I''ve been fiddling with this for over an hour and trying many
different combinations so at this point I''ve lost perspective.
It''s probably something simple but I can''t see it anymore.
I have a component that looks like this:
<% for advertiser_category in
2006 Feb 20
0
How to reference a field of an associated object in a text_field
Hi,
I hope someone can help, I am stumped.
I have a Registration ActiveRecord object. It records registrations
for people for classes.
class Registration
has_and_belongs_to_many :people
has_and_belongs_to_many :scheduled_courses
end
I have a form that allows someone to register. A registration form
will register two people. They fill in their names, addresses, and
the classes they
2006 May 02
2
text_field
Hi, All.
Is it possible to use the text_field with an instance variable.
Controller:
def hoge
@value = ''result''
end
View:
<%= text_field ''value'' %>
It don''t work.
Please help.
--
Posted via http://www.ruby-forum.com/.
2006 May 08
4
<%= text_field %> - how to set the value to session name?
I''m trying to automatically fill a "posted_by" text by with whoever is
logged into the session. How do you set the value attribute using "<%=
text_field ... %>"???
I''ve tried:
<%= text_field ''post'', ''posted_by'', ''value'' =>
User.find(session[:user_id]).name.capitalize) %>
But I get
2006 Apr 08
7
text_field and arrays
Hi,
I''m trying to do a bulk update on an array with the helper text_field.
I''m trying to create an inputfield for every object in the array, but
I''m not getting it right...
example:
class ClassA
@arrayB[]
end
HTML (code with error):
<% 0.upto(9) do |index| %>
<%= text_field ''ClassA'', ''arrayB[index]'' %>
non