similar to: select tag for collection form

Displaying 20 results from an estimated 90000 matches similar to: "select tag for collection form"

2006 Jun 12
3
Multiple Form Fields with Same Model?
Hello, I''m trying to create a form that will allow a user to submit a list of phone numbers, but the list is dynamically created. Thus allowing my form to submit an unknown number of phone numbers. Here is some of the code I have been trying: <%= collection_select( "phone[]", "phone_type_id", PhoneType.find(:all, :order => "position"),
2007 Feb 08
2
One question on select tag
Hi I am now trying to learn some rails tag and encounter one question on "select" tag. == Controller def post_book @book = Book.new(:type => "CS") end == Viewer <%=select "book", "type", [ [" tale", "T"], ["computer science" ,"CS"]...
2008 Mar 11
0
Render multiple tags using helper method
I want to generate a few tags wrapped with a single helper method. For example, I want to generate 5 text_fields by calling a helper method. Can I do that? As far as I know, you can only render once in the helper method (I have tried it and only one or none render method takes effect.) For example, I use a loop contains a text_field_tag method in the helper. It doesn''t work properly. Only
2005 Dec 31
4
saving a collection
Reading the Agile book, I can''t find a single command to save a collection. The save command seems to operate on only individual objects. Lets say I have a collection that I have received from a find_all command. I want to go through and change some attributes in various objects in the collection. Then I want to resave the whole collection back to the database. I don''t think
2007 Jun 06
1
"selected" in form.select
I have a search form in my navbar where a user can select in which area he wants to search. After clicking the submit-button the results get rendered but the previous selected area is no longer selected. <%= form.select (:suchfeld, [ [''Beschreibungen'',''description''], [''Headlines'',''headline'']] ) %> I was able to
2007 Jul 25
5
editing multiple models in one form
Very new to this but would appreciate a hand as this is driving me mad, I''m trying to update both degree and assigned from a single form, the degree section updates fine but assigned just retains the same values, any help much appreciated! my edit.rhtml file looks like: <h1>Editing degree</h1> <%= error_messages_for :degree %> <%= start_form_tag :action =>
2006 Sep 18
3
(slightly O/T) Agile dev. contract form for clients?
Apologies for cross-posting. We''ve been asked to do a job for a client who wants to embrace agile development methodologies. Hurrah! However, our standard contract was written for the 1980s. It is full of phrases like "agreed specification" and "change request procedure" and so on. I was wondering, how do other people get around this in contract forms with
2007 Feb 13
1
form_tag only useful for pages with a single form?
Howdy, I''m new to rails and I''m learning form Agile Web Dev with Rails. It seems all of the examples that use form_tag use it in situations where the action first creates a new object before doing a request.post... If I''m in a situation where I''m managing Roles, Rights, and assignments of rights to roles, I may want to have one little form with a text field and
2006 May 19
2
1 Form for Model containing another Model??
Hi, I can have a Person model with a "has_one :address_email" association, then do the following in my controller: @person = Person.new @person.address_email = AddressEmail.new But, when I have 1 form for "Person" in my view I can''t bind fields in the @person.address_email object with text_field or text_field_tag helpers without getting a "undefined local
2006 Apr 24
3
Form with multiple rows of content
I have looked at examples for this. I found a similar example in the Agile Web Dev... book but that didn''t help. Here''s what i am trying to do. A Cart has many line items. On the Display Cart page, I want to provide the user the option to update quantities. Here''s the rhtml code: <%= start_form_tag :action => ''update_cart'' %>
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
2006 Jan 29
3
Persistent form data (using sessions?)
Hi all, I''ve been struggling with this problem for the past 2 days and still haven''t found a good solution - any help would be appreciated! I have a ''list'' page that lists all products from a DB. On top of that listing I have a little box where the user can specify ''filter'' parameters (eg, book name equals ''foo''). The
2009 Feb 18
2
How to sort select tag options?
Hi, I have a select tag as : <%= select(:feedbacks, :directedto , {"----Select One----"=>"none","Business contact"=>"Business Contact","Technical support"=>"Technical Support","Payment Help"=>"Payment Help"},{ :selected => "none"}, {:class=>"field",
2008 Mar 10
1
spinner in form tag?
Hello! Is it possible to have a spinner in form_tag? like: <% form_tag :action=> ''list'', do :loading=>"Element.show(''spinner'');", :complete=>"Element.hide(''spinner'');" %> ... ... <% end %> If not how could I do it? Thank you! --~--~---------~--~----~------------~-------~--~----~ You
2008 Nov 19
0
has_many through select box in form
Gentlemen, I have searched the group and have not found any post that clarifies thsi s=issue to me. Please forgive me in advance if I missed something. I have 3 models: Ticket has_many :citations, :dependent => :nullify has_many :violations, :through => :citations Violation has_many :citations, :dependent => :nullify has_many :tickets, :through => :citations Citation
2008 Apr 28
2
The name/id of the select tag generated by rails
Hi guys, I just recently fell in love with Rails. Now, I''m trying to make a simple page where at list of tasks is presented. Each task has a user. At the top of the list I want to be able to make a select/dropdown list containing all users, so that will be able to select all tasks for a certain user. Looking at the Rails api I find the helper method: collection_select. Just what I
2006 Nov 23
1
Select Tag not working in 1.2rc1
I''m getting the following error message under rc1: ActionView::TemplateError (wrong number of arguments (1 for 0)) on line #54 of app/views/admin/admin_index.rhtml: In my view (* = Line 54): <%=start_form_tag(:action=>"sales_by_author")%> *<%=select("author","id",@authors.collect {|a| [a.name,a.id]})%> <%=submit_tag("Go")%>
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening: >>> module StoreHelper def hidden_div_if(condition, attributes = {}) if condition attributes["style" ] = "display: none" end attrs = tag_options(attributes.stringify_keys) "<div #{attrs}>" end # format_price method ... end Note that we cheated slightly here. We copied code from the Rails
2006 Apr 11
2
Mapping contained objects to forms?
I''m having lots of trouble trying to map an object that contains another object to the right forms param. So say I have Book which has one Publisher. Here is what I''ve tried: <p><label for="book_publisher">Publisher</label><br/> <%= text_field ''book'', ''publisher.name'' %> </p> Then
2007 Apr 26
0
select tag helper and option values with html entities prob.
Hi fellow Rails developers, I am using option tags with a select form helper. One option values is containing a special character quoted as html-entity ( &auml; ). When I provide the option tags to the select tag helper the ampersand gets quoted automatically. The result is &amp;auml; which doesn''t look as expected. Has anybody an idea how to avoid this quoting? Thanks, thorsten