I have the following code in the controller. I am populating a drop
down box dynamically based on the selection from another drop down

def update_releases project = Project.find(params[:project_id])
releases = project.releases puts "releases==#{releases}"
render :update do |page| page.replace_html 'releases', :partial =>
'releases', :object => releases end view code:

-form_tag reports_path(report_type=1),:method => :get, :multipart =>
true ,:id => "filter" do %table.grid.full %tr
%td.grid.full_panels{:style => "width: 20%"} Project:
%td.grid.full_panels{:style => "width: 20%"} //= select_tag
{:onchange => "#{remote_function(:url => {:action =>
"update_releases"},:with => "'project_id='+value")}"} =
"projects",options_from_collection_for_select(projects,"id","name",params[:projects]), :class
=> "update_releases" %td.grid.full_panels{:style => "width:
20%"} Releases: %td.grid.full_panels{:style => "width: 20%"}
<div id="releases"> = render :partial => 'releases', :object =>
@releases %td.grid.full_panels{:style => "width: 20%"} Cycles:
%td.grid.full_panels{:style => "width: 20%"} <div id="cycles">
= render :partial => 'cycles', :object => @cycles %tr
%td.grid.full_panels{:style => "width: 20%"}
%td.grid.full_panels{:style => "width: 20%"}
%td.grid.full_panels{:style => "width: 20%"} =submit_tag "Submit"
= javascript_include_tag "pages/ic" partials code : = select_tag

Jquery: //change the releases drop down based on the selction of the
projects drop down.

$('.update_releases').live("change", function()
{ $.ajaxSetup({beforeSend: function(xhr) {xhr.setRequestHeader("X-
CSRF-Token", $("meta[name='csrf-token']").attr("content")); }}); var
project_id=($(this).val()); $.post('/reports/update_releases',
{project_id: project_id}); return false; }) I am getting an error
element doesn't support this property" as a pop up on chaning the
selection in the drop down box. Please help me out here.

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouprubyonrails-talk @
postedOct 19, '11 at 3:32p
activeOct 19, '11 at 3:32p

1 user in discussion

Ramya: 1 post



site design / logo © 2021 Grokbase