similar to: How to set the current date to a text_field

Displaying 20 results from an estimated 30000 matches similar to: "How to set the current date to a text_field"

2008 Nov 30
2
How can I set default value for text_field?
Please this code: <p> <%= f.label :"Host Name" %><br /> <%= f.text_field :HostName %> </p> I want to set a default to this text field, how can I do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
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 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 Dec 20
3
Conditional :value in text_field?
<p> <label for="person_languages">Languages</label> <%= text_field ''person'', ''languages'', {:value => "English" } %> </p> I only want to send the value of "English" if @person.languages.empty? Rails doesn''t like my attempts so far. Has anyone been able to do this? -- Posted via
2007 Apr 16
6
How to use a form.check_box ?
Hey guys, I''m trying to have a simple webform in my administration section to add a user. I have the text_fields for adding the user''s name, password, and password confirmation, but cannot seem to figure out the checkbox. I want it to be a single checkbox, that if clicked, will set the database column "access" to be "admin" and if its unchecked, set it to be
2007 Jul 20
4
the value in text_field helper
I have been working on this small, minute, part on my project and it all hinges on setting the value in a text_field helper. Saying: <%= text_field ''user'', ''company'', :value => @login %> does not do it. When I go and look at the raw html, there is no value there and "value" is an attribute of the input tag, im pretty sure. I really like
2007 Jul 04
2
text_field without newline
Hello. I have a very basic rails question. I''m using <%= form.text_field :title, :size => 40 %> to create a text field, but it always creates a newline after it. Is is possible to create this text field so I can enter some text after it on the same line? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2006 Aug 02
0
newbie: Using text_field for date and select_time for time
Hi, I am having java script to enter the date using a calander to a text_field and having separate select_time for the time selection. but we want the controller end to have the normal ruby time format by concatenating the entered time using select_time and entered date using the text_field (via the calendar) Could someone please let me know how I could do it? I am not sure whether I
2009 Jul 21
1
text_fields and habtm
how can i set the text_fields to put data into a model with habtm bindings? Example: model1 has_and_belongs_to_many :model2 how can i insert data into the references of model2 into model1? -- Posted via http://www.ruby-forum.com/.
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 May 09
3
validations erasing the form
Hi there I have a for with a couple of text_fields. I''m doing some validation via the model and when the validation "works" I get there was an error on blah blah the problem is the form is erased and I have to fill up the form again! I saw that scaffold keeps the form filled when the validation "works" but I dont know exactly what''s making it happen! I would
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 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
All, In a template, I have <%= text_field :target_list, :DateReceived, { :title => ''uploaded_at'', :class => ''target_list_info'', :disabled => ''true'' } %> Here is the DateReceived method on my
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
2006 Feb 23
5
text_field not populating, but object exists!
Hi I''m having a problem with a little code here, hopefully it''s easy to see what''s happening: <% @lectures.each do |lecture| %> <%= lecture.location%><br /> <%= text_field ''lecture'', ''location'' %> <% end %> The output I get is the text of the ''location'' rendering
2006 Aug 13
3
why do text_fields appear smaller in IE than other browsers?
In testing my application on different browsers, I''ve noticed a few differences:- a password_field :size=>20 is smaller than a text_field :size=>20 on Internet Explorer. They are the same on Firefox and Safari. makes my login box look silly. the same can be seen on the login screen for this forum. the password box is a little shorter on IE6. more annoying however is I have
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 18
3
populating array of text_fields from an array of model objects
I have in my view the following: <% 0.upto(@num_performances) do |idx| -%> <%= text_field ''performance'', ''city'', :index => idx, %> <%= text_field ''performance'', ''venue'', :index => idx, %> <% end -%> and in my controller I have: @performance = [Performance.new("city" =>
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.
2006 Feb 25
2
How to access param entered through text_field
I''m rendering partial a form comprising several text_field helpers to maintain my User model. For example, the email field is: <p><label for="user_email">Email</label><br/> <%= text_field ''user'', ''email'', :size => ''40'', :maxsize => ''256'' %></p> In my controller,