similar to: 1 Form for Model containing another Model??

Displaying 20 results from an estimated 3000 matches similar to: "1 Form for Model containing another Model??"

2006 Mar 13
4
Trouble Using AR Object based on a Piggyback Query?
Hi, I''m new to Rails and Ruby and can''t access methods/columns from an ActiveRecord object that is a "piggy-back" row as described by David here: http://www.loudthinking.com/arc/000235.html Via Console I can create the piggyback object but reading attributes gives "TypeError: cannot convert String into Integer" (this is in Console and the browser).
2006 Jul 01
3
best approach to add form elements dynamically
I am struggling with how to add dynamically add form elements to a form based on user action. Now here is my situation: I have model Project that has_many line_items On the form to create a project I initially display form elements (some drop downs and text boxes) for adding just one line_item. There is also a button or a link on the page (not sure if this should be in the main form or
2006 Jan 13
5
Form field naming semantics question
Hi, I have a question today regarding how the various form elements in _form.rhtml are named. I understand that for a database table "persons" with a column headed by "name", then in _form.rhtml it will probably be like: <p><label for="person_name">Name><br/> <%= text_field ''person'', ''name''
2005 Dec 01
2
View helpers and nested attributes
Hello all, I have a model with two entities (document and asset) and a 1:1 relationship defined between them (every model has an asset). I want to generate a rthml view that generates a hash for document attributes and a nested hash for asset attributes (for example {:document =>{:name=>XXX :asset => {date =>XXX}}) According to the Pragmatic Programmers book (page 355), the input
2006 Apr 26
5
Best way to split forms into steps?
I have a form with about 30+ fields, which the client is wanting to separate into 3 pages/steps - just wondering what is the best way to go about this, specifically remembering data entered, from one page to another, and making sure the various bits of data are validated correclty, error messages outputted etc etc... is there a best practice method for doing this? -- Posted via
2006 Mar 15
7
Populating text_tag with serialized data
I am using a serialized attribute in one of my models The serialized data is in the form of an array. I want to have a text_tag for each element contained in my serialized attribute. How would I construct the text_tag? My model name is ''questions''. The serialized attribute is "answers" So I might have: <% form tag %> <% text_tag ''question'',
2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All, I''m having a hell of a time figuring out what is going on here. I''m trying to override one of my getters so that I can format it a certain way in my form. But I can''t seem to get text_field to call the appropriate method on my object. So here''s my getter: public def FAX fax = read_attribute(:FAX) puts fax
2008 Jan 25
2
form formatting
If I want to use fbml elements and rails tags, is there a way to do within a fb:editor? if I do: <% facebook_form_for(:task, at task,:url => create_task_path) do |f| %> Assign Task To: <%= fb_friend_selector %> <%=f.text_field :ttype, :label=> "Title"%> <%=text_field_tag :newrnumdays, ndays, :label => "# Days"%>
2006 Apr 08
2
ActionView::Helpers::FormHelper instance methods should take an object reference rather than an object_name.
Hi ActionView::Helpers::FormHelper methods (e.g. #text_field, #check_box...) take object_name as an argument. From this argument they infer a name that is supposed to contains the reference to the relevant object. I can''t see why the FormHelper methods were designed that way. Compared to simply passing them a reference, the current way seems too complicated and an invitation to problems
2006 Mar 30
7
text_area
How to make that the typed code on ruby in text_area it was carried out in @params ["name"]?? -- Posted via http://www.ruby-forum.com/.
2006 Jul 21
1
How to dynamically add more rows and submit data
Let''s assume that I am trying to build an application where the user can enter invoice. In the app the user can add lines items. Each line item has decription, date, rate and hours. When the invoice screen comes up the first time I have one blank row for the line items. <tr> <th>Description</th> <th>Date</th>
2009 Apr 05
2
Prohibit removing INBOX
Hello list, I'm using dovecot 1.1.11 and I'm going to prohibit users to remove their INBOX and some other directories in the mailbox root. I used Access Control Lists (http://wiki.dovecot.org/ACL) to do this: protocol imap { mail_plugins = acl } plugin { # With global ACLs in /etc/dovecot/acls/ directory: acl = vfile:/etc/dovecot/acls } /etc/dovecot/acls/.DEFAULT: owner
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
2015 Sep 08
3
Multiple vacation
Hi all I'm using Dovecot 2.2.9 and I'm having problems configuring multiple vacation actions. The problem is that I'd like to have two different senders and two different messages, selecting the correct case by the recipient email address. I mean, if someone writes me to my email address "to-address1 at example.com" I'd like to answer from "from-address1 at
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 Apr 06
3
Inserting parent_id
I have two tables: - projects - lines lines has a foreign key constraint to projects.id When I''m creating a new line object, the database fails on insert with the following error: "PGError: ERROR: null value in column "project_id" violates not-null constraint" My code looks like this: def create_lines @project = params[:id] @line =
2006 Feb 04
1
Error when using form helper and child objects
Hi, This is one problem that has gotten me stumped for quite a while. I have an Item that has_many :DeliveryMethod, and what I seek to achieve is to create a form that''d let me create an Item, as well as its DeliveryMethods in 1 single form. And so I tried something like: <%= text_field_tag ''Item[DeliveryMethod][price]'', @Item.DeliveryMethod ?
2006 Mar 26
2
Shared Columns in an STI
I have a an STI table which acts_as_tree, that has a large number of classes/types. My common fields are: id parent_id name description with 4 more text fields, I could cover most of my classes if I could redefine the name of the field like this. text1 AS address1 text2 AS address2 text3 AS zipcode For one class and text 1 AS model_number text2 AS vendor Is there a construct that will allow
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 Jul 15
4
updating multiple records with form
I have an app that has two models -- products and details. I''m building a form that allows a user to create a new product and specify a description, etc. The form needs to allow for creation of multiple items in the details model/table. for example, I have a block of form items that collect info for the men''s version of the product -- inventory count for each size, etc. And