search for: text_field

Displaying 20 results from an estimated 798 matches for "text_field".

2006 Aug 03
5
Rails - forms
Currently I have a registration form that is built like this: <label for="First name">First name</label> <%= text_field "user", "first_name" %><br> <label for="Last name">Last name</label> <%= text_field "user", "last_name" %><br> <label for="Email">Email</label> <%= text_field "user", "email&qu...
2006 Mar 18
9
Using <%= text_field %> within partials is problematic
All, Thanks for any help in advance. I have what I think is a very straightforward partial template and I can''t figure out why a text_field call within it doesn''t work. Here is my calling template: lists.rhtml <div id="target_lists"> <%= render(:partial => "target_lists", :collection => @target_lists) %> </div> In the partial template: _target_lists.rhtml, if I have the follow...
2006 Feb 24
1
Help a n00b?
...odList'', :position => ''bottom'', :complete => ''$ (createFoodForm).reset();'' ) %> <td class="txt"><%= text_field ''food'', ''name'' , "size"=>20 % ></td> <td class="num"><%= text_field ''food'', ''serving'' , "size"=>5 % ></td> <td class="txt"><%...
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 correctly, and then an empty text input box! If the text can render then I must have an object, so why doesn''t the text_field cr...
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" => "T...
2006 Jul 11
4
add method parameter for form helper
Hello, Most of the form helpers are build using Object / Method without the possibility of using a method parameter (as I know ...) text_field(object_name, method, options = {}) how do you solve this problem ? -> (I did my own helper and generate the html ... well I think there is a better way;-) -> do I have to overide text_field(object_name, method, parameters {}, options = {}) thanks arnaud
2006 Jul 21
1
How to dynamically add more rows and submit data
...st time I have one blank row for the line items. <tr> <th>Description</th> <th>Date</th> <th>Hours </th> <th>Rate </th> </tr> <tr> <td><%= text_field ''lineitem'',''desc-1'' %></td> <td><%= text_field ''lineitem'',''date-1'' %></td> <td><%= text_field ''lineitem'',''hours-1''%></td>...
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 =&quo...
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 woul...
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]''...
2006 Feb 07
3
Newbie help ..
...following error. Any help appreciated. -m. $cat app/views/admin/new.rhtml <% @page_title = "New member..." -%> <%= start_form_tag( :action => ''create'' ) %> <table> <tr> <td> First Name: </td> <td> <%= text_field( "member", "first_name", size => 40 %> </td> </tr> <tr> <td> Last Name: </td> <td> <%= text_field( "member", "last_name", size => 40 %> </td> </tr> <tr> <td>...
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 errors. If someone can tell me how to do this simple thing, I would really appreciat...
2006 Apr 25
2
Noob Question: REgarding Forms ( Take 2 )
I''m hoping there''s an easy way to do this. I''m trying to read options from a database, and insert them into form tags. So for example, In the Database Table: options size: 300 type: text_field maxsize: 300 and I want to create a text_field form tag, with all the appropriate options, is there an easy way to do this, other than having the code output the HTML directly? I know I could just have the view put out; <input name= etc... but I want to use the Ruby Form helpers. <%= t...
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...
2009 Nov 06
0
Nested objects not propagating from view
...quot;> => nil As you can see, it appears to work fine, but the following views for new.html.erb and edit.html.erb don''t: <h1>New account</h1> <% form_for(@user) do |f| %> <%= f.error_messages %> <p> <%= f.label :login %>: <%= f.text_field :login %> </p> <p> <%= f.label :first_name %>: <%= f.text_field :first_name %> </p> <p> <%= f.label :last_name %>: <%= f.text_field :last_name %> </p> <p> <%= f.label :email %>: <%= f.text_field :email %> </p&...
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 http://...
2006 Aug 16
4
Overwrite form helper methods and call old ones in new ones?
Hi all All my forms should look the same, so I think always putting the right div etc. tags around them is a violation of the DRY principle. Until now my forms look like that: <div class="text_field"> <label for="news_item_subject">Subject:</label> <%= text_field "news_item", "subject" %> </div> Now I want the default form helper methods to do that all for me: <%= text_field "news_item", "subject", :label...
2005 Dec 29
5
Model Composition in Rails
...out the naming and referencing of the sub models (i.e. P4.p4_priorities - seems simple enough but I had weird issues related to it). I''m all ok except that I am having issues with how to reference a ''sub-model'' in a form field. This is what I have: <%= text_field ''p4_p4_priorities'', ''detail'', :size => 75 %> No errors - it''s just not saving which tells me the framework isn''t understanding what to save. Can you help? Also, the models associated with the related tables have validation but that doesn...
2006 Jul 06
4
ERb question: Embedding <%= %> in helper method calls
I had a situation where I wanted to use a <%= %> (scriptlet) in my text_field call to set the "disabled" attribute on the text field, like so: <%= text_field(:current_job, ''removeLinkPos'', :value => '''', :id => ''offset'', :maxlength => 2, :disabled => <%= sometest ? ''true'' :...
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. --