similar to: :onchange in rails 3

Displaying 20 results from an estimated 10000 matches similar to: ":onchange in rails 3"

2012 Feb 12
3
Rails routes - destroy
Can''t figure out how duplicate routes are differentiated by rails ... Read routing from inside out and API as well as a few tutorials but still don''t get it!!! For example... routes.rb resources :minisections do resources :questions end rake routes: minisection_question GET /minisections/:minisection_id/questions/:id(.:format) questions#show
2007 Jan 25
2
React on select_tag (onchange)
Hi, I''m new in developint rails (but I love rails). I would like to react on changing a field in the view (no model field) from a selection box to show the number of rows (which I used in the controller). In the controller I read the params-hash: ... @rowsperpage = params[''rowsperpage''].to_i ... In the view I have the field, where I like to react directly. ...
2006 Aug 07
2
Select Box Question
Hi, Yet another newbie here... I''m writing an appliction in Rails, and I''ve Ajaxified my select boxes so they update dynamically. I used the "observe_field" method to monitor changes to my select box. I find that it''s kind of erratic... it updates constantly and makes the selection for me, based on where my mouse happens to be hovering when it does its
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select field, such as <%= collection_select("job", "client_id" , @clients, "id", "name") %> with onChange="xxx" Anyone know how to make this work? Thank you, Scott -- Posted via http://www.ruby-forum.com/.
2006 May 22
15
collection_select default selected value
Hiall, Unfortunately I just can''t find out how to setup a default selected value when using collection_select. My call is like so: <%= collection_select(:consultant, :lastname, @consultants, :id, :lastname, { :selected => @current_consultant.id } ) %> which is not working, I debugged so far that I know that @current_consultant.id contains the correct value. Any tips? cheers
2008 Apr 02
4
options_from_collection_for_select
I have a drop down of country''s and I would like the USA to be the first displayed. I have tried: <select id = "user_w_country" name ="user[w_country]" onchange = "<%=func%>"> <%= options_from_collection_for_select @country, ''id'', ''country'', :selected =>
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/.
2005 Dec 21
3
How to make a drop-down automatically submit an AJAX form
Hi, I know that to make a dropdown box automatically submit when you change the value, you do this: <select ..... onchange="this.form.submit();"> BUT i''ve got an ajax form, and if i do the above trick, it simply reloads the ajax partial into the whole screen, rather than into the div where it is meant to go. I''ve already got it all working so that if you click
2013 Jan 18
2
options_from_collection_for_select
I have just started using RoR and am creating some select boxes on my form with the following code: <%= select_tag(options_from_collection_for_select(Owner.all, :id, :fname)) %> My problem is that it does NOT return the first record from the table, but just the second and succeeding records. Does anyone have any ideas on how I can get the first record included in the select box? Thanks.
2006 Apr 22
2
selected value
I would like to pass the value selected in a select statement back so that I can use it in the controller, through using a remote_function call, and I cannot figure out what I am doing wrong: view rhtml: <select id="widgets_id" name="widgets[id]" onchange="<%= remote_function( :update => "parts", :url=> { :action => :loadParts } )
2006 Jun 14
4
Select box onchange problem
Hi, i''ve got the following problem. I have a check_box witch shows a list of varieties. Now i want to call a action when the user changes his selection. (the method to be called, will store the selection from the user). This is my code: <%= select(''variety'', ''variety_id'', Variety.find_all.collect {|c| [c.description, c.id]},
2008 Jul 31
2
selected value for options_from_collection_for_select
Hey, I am trying to get a select list with a selected value in it. Even if I put in an integer, like this, <%= select_tag(fruit.id, "<option>No Contract</option>" + options_from_collection_for_select(@fruit_types, "id", "kind", 3)) %> the list still displays the first option (No Contract) in the list. What am I doing wrong? I''ve looked
2006 Jan 08
2
RoR AJAX select box update?
Hi, I want to update a select box depending on another selected option thru ajax. Heres how I do it # _form.rhtml <select id="budget_coordinator_id" name="budget[coordinator_id]" onchange="<%= remote_function(:update => "budget_project_number", :url => { :action => :get_projects }) %>"> <%=
2006 Mar 29
4
using onchange options in forms
Hello, I''m trying to get a select field to update a view via the ''onchange'' option. I''ve seen examples of it here in the forum where people hardcode the forms and use javascript to trigger the change (and nearly all have complained that it''s a hack) and I''m wondering if anyone has a more elegant solution using the embedded ruby methods?
2006 Oct 28
2
onchange="document.forms[0].submit()" - how to CANCEL
Goal: I want to auto-send a form whenever any field changes. The page will be updated "via Ajax", so standard submission is cancelled. Idea: Add onchange="document.forms[0].submit();" to every field Problem: Can not cancel form submission. Browser redirects to "results" page, which is of course JavaScript meant to dynamically update the page. RHTML snippet:
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 Jan 09
7
Large select list, speed issues
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> <font size="-1"><font face="Verdana">I have a piece of code in my page to generate
2005 Nov 22
3
non model select_tag problem
What am I doing wrong here: select_tag(''website_ids[]'', options_from_collection_for_select(Website.find_all, ''id'', ''name'', params[:website_ids]), {:multiple => true, :size => 5}) It works fine except that it does not display the selected options once the form is submitted (it submits to the same page). The
2006 Jan 19
2
select vs. select_tag
I have a "Users" object and a "Timesheets" object. Each timesheet entry belongs to a User, which is selected from a drop-down list. The timesheet has a user_id field. (The user needs to have an option to select a different user due to the way our system works.) If i use the "select" object, which is bound to the Timesheet model, using this code: &lt;%= select
2006 Jul 26
4
Dropdown with concatenated columns.
What is the best way to create a drop down where the viewable text in a concatenation of 2 or more columns? For instance, I hane a lookup table with these columns. Model FOO columns: id , name, phone In my drop select tag, I''d like the user to see: "name1 phone1" "name2 phone2" etc.. I know I can do this using find_by_sql . .. But, isn''t there a more