you need to include a option
,
:with=>"'state='+document.getElementById('selected_district_state').value")

for your periodically call control..
<%= periodically_call_remote(:url => { :action=>"show_current_readings" },
:frequency => 5,
:with=>"'state='+document.getElementById('selected_district_state').value")
%>

I will send more hints later.
Nitin

On Thu, Mar 18, 2010 at 9:53 AM, Veena Jose <[email protected]> wrote:

> Hai Bala,
>
>      I hav looked into the development.log file.I understood that the
> problem as in "_current_readings_list" it is not getting the id
> parameter based on which it has to display the readings.I dont know
> whether i am correct or not.
>
> I am attaching the development.log file.
>
> controller
>  def show_readings_for_station
>     @range=ConfigureParameter.find(:all)
>    if (params[:state] =="")
>      @readings = CurrentReading.find(:all)
>    else
>    stations = Station.find_all_by_state(params[:state])
>    @readings = CurrentReading.find_all_by_station_id(stations,
> :order=>"station_id")
>  end
>     respond_to do |format|
>      format.js
>    end #End of respond_to do block
>  end #End of action show_readings_for_station
>
>  def show_current_readings
>   @range=ConfigureParameter.find(:all)
>    if (params[:state] =="")
>      @readings = CurrentReading.find(:all)
>    else
>    stations = Station.find_all_by_state(params[:state])
>    @readings = CurrentReading.find_all_by_station_id(stations,
> :order=>"station_id")
>    end
>    render :update do |page|
>      page.replace_html :current_reading,
> :partial=>'current_readings_list'
>       page.visual_effect :highlight, 'current_reading'
>    end
>  end
>
> index.html.erb
>
> <% form_for :selected_district ,:url => {:action =>'update',:id =>
> @selected_district } do |f| %>
>   <center><b> <%= f.label :Stations  %></b>
>
> <%= select(:selected_district,:state,
> @states,{:include_blank=>'All'},{:onchange
> =>remote_function(:url=>"/readings/show_readings_for_station",:with
> =>"'state='+this.value")} )  %>
>
> </center>
>
> <%end%>
> <div id="reading_list">
> <% form_tag  :action =>"details" do %>
>  <div id="current_reading">
>  # code here
>  </div>
>      <%= periodically_call_remote(:url => { :action=>
> "show_current_readings" }, :frequency => 5)%>
> <%end%>
> </div>
>
> Can you plz tell me how can i get the id of the selected element in
> select tag to the action "show_current_readings"? If i am wrong plz do
> correct me..
>
> Thanks,
> Veena
>
>
> Attachments:
> http://www.ruby-forum.com/attachment/4596/development.log
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to