similar to: Ruby on Rails drop down help

Displaying 20 results from an estimated 4000 matches similar to: "Ruby on Rails drop down help"

2006 Feb 19
8
select, first option empty value?
using the below: <%= select(''project'', ''project_type_id'', @project_types.collect {|x| [x.name,x.id]}, {:include_blank => true}) %> but i''d like that first option to have something like "select project type" with an empty value?
2006 Apr 23
3
custom form builder
In the API docs I found this: "You can also build forms using a customized FormBuilder class. Subclass FormBuilder and override or define some more helpers, then use your custom builder " I couldn''t find any further documentation on this. Where can I read more about this formbuilder class? For starters, where would I define a subclass of this class? TIA, Jeroen --
2007 Oct 05
13
spec''ing view render partial collection, local variable not found
I''m trying to spec out a render partial collection but I get the following error 2) NoMethodError in ''/games/_game.rhtml should show game name'' undefined method `body'' for #<#<Class:0x316580c>:0x2f1154c> /Volumes/EXTERNAL/web/omenking.ca/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb:12:in `matches?''
2009 Jul 18
2
Sharing controllers/models within a view
Hello, please forgive me if this answer is obvious! I''m new to Rails this week. I have two database tables, and the associated scaffolding, controllers, models and views. The first is service_provider, which holds a list of service providers. The second is service_provider_countries which is a table of countries (obvious perhaps). In views/service_providers/new.html.erb I have a form,
2009 Sep 02
8
select_month helper
I''m trying to rewrite a fusebox-like application (Active4D plugin to 4D database) in RoR/postgres and I''m doing okay - but keep running into things that stump me. It seems like it takes me hours to figure out something that I could have written in pure code in minutes. The select_month and select_day helper has been my latest waste of time. All I''m trying to do is add
2008 Feb 28
2
change drop down list to radio buttons
In my RoR app I would like to change a drop down list, which dispays a list of colors selected from the database. Instead I would like to create a radio button for each color. The user is allowed to check one color and this will be saved back into the database as the color for this user. I don''t know how to do this. Currently it looks like this: <%= select(:user, :color_id,
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 <<
2006 Apr 06
6
select method
The documentation states as an example: select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) could become: <select name="post[person_id]"> <option></option> <option value="1" selected="selected">David</option> <option
2009 Jan 08
4
Problem with disable_with
Hi Group, I have a registration.html.erb page with the following JavaScript at the top which I use to validate form fields: <script type="text/javascript"> <!-- function validate(){ if ((document.myForm.email_projectname.value=="")|| (document.myForm.email_projecttype_id.selectedIndex<1)|| (document.myForm.email_region_id.selectedIndex<1)) { alert
2006 Jul 20
4
drop down list
hello friends , can u pls tel me how to add drop down list in railsapplication -- Posted via http://www.ruby-forum.com/.
2006 Feb 21
4
Select error
This code: <p> <label for="resource_type">Type</label><br/> <%= select(:resource, :type, %w{ Web Data }, { :include_blank => true }) %> </p> Produces this error: TypeError in Resources#new Showing app/views/resources/_form.rhtml where line #6 raised: wrong argument type String (expected Module) Extracted source (around line
2009 Nov 02
4
Ruby Gems version issue
Hi, When I try to launch my ruby on rails server, it says my ruby gems version is not up to date. However it is. I''ve even tried reinstalling ruby gems to the latest version, but it still says I have an old version. Does anyone know how to fix this issue? I''d be deeply grateful. Here is some code directly from my terminal (I''m on an ubuntu system):
2006 May 26
7
Instant Rails and your own applications
Hi, I want to make an open source rails project as easy as possible to install. Can I use Instant Rails for this? I treid to look at the FAQ but could not see this was possible. Ideally I would like to have Instant Rails install Ruby, Rails, MySql, etc and then have it add my application and add the mysql user (could be just root also) and then the sql for creating the tables. Sound like fun
2006 Jul 02
6
remote form w/ evalScripts:true
Hello. I want to select an item from a select list and have that result in an ajax call that updates two sections on the page. Here is the code in the controller def create ... render :update do |page| page.replace_html ''list_items'', :partial => ''lists/list_items'' page.replace_html ''add_item'', :partial =>
2006 Jan 04
5
How do I set the default value for date fields?
I want my date fields to default to NIL or "", because the presence of a date means something. My problem is that rails is defaulting the fields to today''s date automatically when I create a new record through the scaffold. I tried removing the default ''0000-00-00'' and changing NOT NULL to NULL, but both columns get today''s date as the default
2006 Jun 16
3
us_states plugin
Hello, I am trying to figure out how to use the options available with the us_states plugin. What is the proper syntax for using the :priority and :with_abbreviation options? Thanks, jeremy
2010 Apr 16
1
time_zone_select :priority_zones not working properly
I sent this earlier but I don''t think it ever came through. Sorry if this is a reposting. When using :priority_zones for time_zone_select in a manner described by the API docs for ActionView::Helpers::FormOptionsHelper I''m getting errors. Here is an API docs example: time_zone_select( "user", ''time_zone'', TimeZone.us_zones, :default =>
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a behavior similar to what you get using date_select with the :include_blank => true option where the first value in the dropdown is "- Month -", "- Day -", or "- Year -" rather than a blank value for the respective month, day, and year select fields. I took a look at the ruby source for
2006 Jun 12
1
Instant Rails and your own applications
?I like your form css at http://www.pllite.com/projects/new Nice stuff! Stuart -----Original Message----- From: ian.connor at gmail.com Sent: Monday, June 12, 2006 3:14 AM -07:00 To: instantrails-users at rubyforge.org Subject: [Instantrails-users] Instant Rails and your own applications Here is the download link for the Instant Rails version of ProjectLounge Lite.
2012 Aug 16
6
undefined method `with_indifferent_access' for "":String
Hi I''m having a issue with one object when try to update the attributes in this object previously saved in the database I have one object comp and one object reg they have this relationship comp has_many regs reg belongs_to comp when run use the method valid? like this current_contribuyente.comps.build(params[:comp]).valid? it returns: IndexError (string not matched) And when