Displaying 20 results from an estimated 1000 matches similar to: "how to add onchange javascript event to select field"
2006 Feb 10
2
How do I test actionview helpers in the console?
I would like to see the output of actionview helper methods, to be able
to play with it.
When I do the following in the console:
collection_select("job", "client_id" , @clients, "id", "name")
I get:
NoMethodError: undefined method `collection_select'' for
#<Object:0xb7cf1970>
I''d like to get something like:
<select
2006 Apr 24
4
creating a select box
Hi
trying to create a select box in _form.rhtml.
I have a table called organisations that contains fileds, 2 being ''id''
and ''name''
these are the fields I need to bring over to the clients _form.rhtml.
whats the best way of going about that??
2 ways i have seen suggested that I cant get to work
-@organisations = Organisation.find_all placed this in def new
2006 Jun 28
6
select_tag
in my controller
@cursos = Curso.find_all
in my view i''m trying to do a select_tag with the results @cursos, using
a helper
select_tag "name" options_for_select(@cursos) --------> not works
select_tag "name" @cursos --------> not works
how to do it, using the helper?
tks
--
Posted via http://www.ruby-forum.com/.
2009 Jan 28
1
How to give onchange for select_year rails helper....
<%=select_year(Date.today,:include_blank=>true, :start_year =>
Date.today.strftime("%Y").to_i, :end_year => 1999)%>
i am using rhis helper... now i want to give onchange here....
Please help me to solve this ....
thanks in advance
JK
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because
2006 Apr 13
1
Adding a title to an AJAX link.
Hello all.
I am trying to add a title to a link_to_remote created AJAX link.
What I want to create is:
<a href="#" title="VALUE-HERE" onclick="new Ajax.Updater(''content'',
''/area/show/28/40'', {asynchronous:true, evalScripts:true}); return
false;">Area Name</a>
However I cannot seem to get it to work, the API says
2010 Oct 06
4
List of html_options available
I''ve noticed lots of people online complain about not good documentation
for Rails. I''m a PHP programmer but I''m a newbie on Rails.
I''m creating a form with a drop-down menu. I finally got to do it. I
noticed there is a html_options parameter for select. I was curious as
to what other html_options are available but couldn''t find a list of
options. I
2009 Jan 28
3
Apply style in collection_select ?????
Hi to all,
i have this snip i want to apply style to this combo but there is no
effect
help.......
<%= collection_select(:customer,:country_id, @countries,:id, :country,
html_options={ "style" => "width:110px" },:onchange =>
''updateState('''');'',:id =>''country_id'' )%>
Thanks,
--
Posted via
2006 Aug 16
1
how to update a collection_select from another
I have two collection_select in my list.rhtml:
<%= collection_select (:region, :id, @regionall, :id,
:title,html_options={:onChange => "new
Ajax.Updater(''related_provinces'',''/categories/related_provinces/" +
"?id=''+this[this.selectedIndex].value,
{asynchronous:true, evalScripts:true});"}) %><br>
<%= render :partial =>
2005 Dec 29
3
Post problem with select lists
hey,
i have this problem
how come i always get -1 for the select list??
rhtml
First, select a client.
<select id="client_id" name="client[id]" onChange="submit();" >
<%= options_for_select(@client_options, @client_id.to_i) %>
</select><%= @client_id %>
controller
if @request.post?
if @request.xml_http_request? #called by ajax,
2007 Dec 02
4
select and passing some javascript
Hello,
After reading and reading the documentation, I can''t append some
javascript function into a select.
It''s not possible ?
documentation:
-------------------------------------------------------------
select(object, method, choices, options = {}, html_options = {})
some code:
-------------------------------------------------------------
return select(:id, :year, [
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
2007 Dec 22
3
collection_select validation problem
I''m trying to assign a parent foreign key value using
collection_select from my child "new" form. The problem I''m having is
if I do not make a selection, I get the following error instead of the
Rails validates_presence_of error:
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occurred while evaluating
2010 Jul 16
31
Added associations but don't see generated methods
Hi,
I''ve got a Rails app working that includes two two classes, etc.:
Expense & Vendor. I eventually learned that the mental concept I had
of their relationship should be express in Rails as:
class Expense < ActiveRecord::Base; belongs_to :vendor; end
class Vendor < ActiveRecord::Base; has_many :expenses; end
2006 Jul 08
10
A rant about parameters
Guys,
I''ve been chasing a problem with country_select for the past few hours
now. My intention was pretty simple...use the following line in a form:
<p><label for="country_region">Country</label>
<%= f.country_select :country_region, "United States" %></p>
However, for the life of me, I couldn''t get it to work. I kept getting
2005 Jan 25
4
Collection_select with multiple options
Hi,
I have built a select field that allows multiple options selected with
collection_select and "multiple"=>"multiple". How do I go about
receiving the values? If I use a variable name like collection[], it
complains that I can''t use @collection[] as the instance variable.
TIA
victor
2006 Jan 25
2
select list generated from table
Have 2 tables - clients & case_managers
class Client < ActiveRecord::Base
has_one :case_manager
end
app/views/clients/_form.html contains line...
<p><% collection_select("client", "case_manager_id", \
case_manager.find_all, "name", "id") %></p>
and this line generates error...
undefined local variable or method
2006 Apr 21
1
select box with multiple rows
I want a select box that displays 5 rows instead of one row and a drop down.
so i figure this should work, but it doesn''t.
<%= collection_select(:constellation, :region_id, @regions, :id, :name,
html_options = {:size => ''5''})%>
I am not quite sure how to use that html_options and googling around I didnt
find anything directly on point.
Any suggestions?
2006 Jun 09
0
options vs. html options in collection_select
I wanting to add an onchange event handler to collection_select but I''m not
sure how.
The api gives the signature as
collection_select(object, method, collection, value_method, text_method,
options = {}, html_options = {})
I''m not sure, however, if I need to place the desired code in "options" or
"html_options". I''m sure I could just figure it out
2006 Apr 27
4
select item based on previous select list selection?
So I have a select list with a list of items. When a user selects an
item, another select list should have its default selected item set to a
specific item (the default associated with the first select list).
This is in a form to create a new task. The first select list is a list
of parent tasks. When one selects the parent task, the clients select
list must default to the same client as its
2006 May 25
4
How to add a migration with a plugin?
I''m working on a plugin that requires some database support to do its
job (adding a model or two). I''d like the plugin to automatically add a
migration once it is installed. Is there already a mechanism for this?
If so, how do you do it?
--
*Berin Loritsch*
Owner
*Work:* 571-215-7708
*Email:* bloritsch@d-haven.com <mailto:bloritsch@d-haven.com>
*IM:*