similar to: Can''t get select helper to populate dropdown w/default value

Displaying 20 results from an estimated 2000 matches similar to: "Can''t get select helper to populate dropdown w/default value"

2006 Apr 19
2
select_tag and :include_blank => true not working
Guys, I''m using select_tag to display a non-model dropdown, which works fine. However, I''ve tried every which way to use the :include_blank => true option, but it simply won''t display a blank value. Using :include_blank => true with select on model fields works fine. Can someone please show me a working example? -- Posted via http://www.ruby-forum.com/.
2006 Jul 13
2
Simple dropdown menu
Hi, I''m quite new to this language and I''m having trouble finding out simple things like a dropdown menu in rhtml. I know I have to use <% select_tag %> but I''ve read lots of different ways to put in the options so I''m a bit confused. Options are hard-coded for the menu I''m trying to create so no database is involved! Thanks v much! Bex --
2006 Apr 22
3
Creating a select dropdown box with links to methods
What would be the best way to create a form select dropdown box and upon "submit" have it directly go to a controller method view? I have something that somewhat works, but I think there is probably a much easier way to do it. As of now, I have the dropdown list which when the form is submitted is handed to a controller method which basically I have my dropdown box: <%=
2006 Mar 22
1
HABTM / Dropdown Help Needed
I''m terribly new to Rails, so bear with me. I have an application I am working on which deals with projects and subcontractors. There can be several subs on each project and each sub can work on several projects. I have my join table set up and has_and_belongs_to_many in both models. If I manually put data in the join table, this works in my show view: <% for subcontractor in
2008 Jul 26
1
Dropdown selected value not reflecting in edit view
hi I am facing the following issue: I have the following dropdown, in the new view select_tag "experience[]", options_for_select([[less_than_1_year, [0,1]],[between_1_and_3_years, [1,3]],[between_3_and_5_years, [3,5]],[between_5_and_7_years,[5,7]], [between_7_and_10_years,[7,10]], [above_10_years,[10,50]]]) The selected value of the user is not getting reflected in the Edit view of
2006 Jan 31
2
Need advice on RoR app design
Fellow Railers, Is there anything, anywhere, that I can read that discusses overall RoR app design? I have the Agile RoR book, which is great for learning the details of RoR, but unfortunately doesn''t cover the overall issue of creating a large, complex RoR app. My staff and I are still in the process of getting up to speed on Ruby and RoR, but we also need to begin thinking about
2006 Aug 06
1
Newbie: populate 2nd dropdown list based on user''s selection in 1st dropdown list
Hi, I am creating a form that a user can post a message based on his selection on category and subcategory. (A category has many subcategories.) How do I dynamically populate subcategory dropdown list when user chooses a category from category dropdown list? Thanks in advance. -- Best regards, Ming Ma
2006 Jan 06
12
Auto refreshing a page based on select change
Hi all, I have a select helper form on a web page which contains a list of dates. When the user selects a date, one of the other forms on the page needs to be updated based on the newly selected date. Is there a way to catch this event in Rails? Are we talking Ajax here? Or is there a simpler way? Thanks, Dan
2006 May 26
4
Jamis, problem w/Capistrano
Jamis, I''ve spent hours trying to get Capistrano working, to no avail. I''m hosting over at www.railsplayground.com, and here''s their instructions I''ve been following: http://tinyurl.com/hyo93 I can''t get past step 7. When I execute "rake remote:setup", I get a rake aborted! message. When I do a "rake --tasks", I get only a
2010 Dec 22
1
'No route matches' error with select_tag
Rails 3: I have a view books/:id/show.html.erb - in the view, I have a form with a select tag to pick a template, that on dropdown should submit the form which rerenders the page based on the selection: <%= form_tag book_path(@book) do %> > > <%= select_tag "template[]", >> options_for_select([["Template1","template1"], ["Template2",
2006 Apr 27
0
Dropdown list to populate drag and drop sortable list
I''m listing bands playing shows. I want to be able to add and sort the lineup for each show in a single form. Users select a band playing from a dropdown list, which (using Ajax) adds the band to an unordered list which they can then re-arrange. Are these any tutorials online that cover this? Or can anyone shed any light on it? I''ve used a modified version of Cody Fausers code
2009 Mar 06
0
How to populate form dropdown with 2nd item of model
I''m trying to create a dropdown list that''s populated from a model but which has the 2nd item in the model as the default selection. This is possible. Here''s the model snippet. PROPERTY_TYPES = [[''Choose'', ''''], [''Residential'', ''Residential''],
2007 Jul 17
5
habtm confusion
Hello friends! I am trying to make a database that will have a group of people set to committees, and a person can be in multiple committees, and a committee obviously has multiple people. The people are senators at my university. These are my current models: senator.rb: -- class Senator < ActiveRecord::Base validates_presence_of :first_name, :last_name, :floor has_and_belongs_to_many
2006 Apr 07
3
Inline editing of datetime and dropdown select objects?
I don''t believe that Rails has support for the inline editing of datetime objects or dropdown combo boxes. Does anyone have a helper function or two that would allow me to do such a thing? -- Posted via http://www.ruby-forum.com/.
2006 Jun 05
2
dropdown
I''m using a dropdown on my form for a simple cms which displays the pages from the database. I want to add some options to the dropdown that are not in the database. Is there a way to do this? Here''s my code so far: <p><label for="navigation_link">Link</label><br/> <%= select("navigation", "link",
2013 Jun 18
1
How to Pass Jquery selected dropdown values and radio button values to controller
Hi, I have an advance search page and its code is as follows - I have written my code like this <div class="container"> <%= form_tag search_index_path, method: :get do %> <%= radio_button_tag ''user_type'', ''customer'' %><p>Customer</p> <%= radio_button_tag ''user_type'',
2006 Aug 18
2
How do I sort the drop-down list?
I''ve added a drop-down list of first and last names of borrowers to a form. How do I sort them by LastName, FirstName in the drop-down? I''m using code based on the cookbook example: <select name="borrower[borrower_id]"> <% @borrowers.each do |borrower| %> <option value="<%= borrower.id %>"> <%= borrower.FirstName <<
2010 Apr 10
2
Need a dropdown having "more.." option
I have a collection of products that I am showing in a dropdown. Now at the first view it will show only first 10 products in the dropdown with an option "more..." at last. if user clicks the "more..." he can see all the following products in that dropdown list (this is not any ajax request, just javascript show/hide). Of course the more... option will hide when showing all
2006 Jun 08
1
built-in dropdown jumps?
Hey everybody! I was just wondering if Rails'' javascript library includes something as simple as making a dropdown that jumps to the link when selected without needing a "submit" button. I see a bunch of AJAX effects and draggable-element stuff, but all i need is a simple dropdown... should I code it myself? -- Posted via http://www.ruby-forum.com/.
2013 Jan 30
1
DropDown onChange event update the table in view
Hi all, I am fairly new to ROR and recently i created an application where i have a combobox when on select the item from combobox i need the table in the view to be updated based on the selection of the item selected in the combobox. I need to do it using javascript , the whole data should be retrived once and when the user selects the item from combo the table data should get updated without