I have the following in my view:

<%= observe_field 'guarantee_status', :url => {:controller =>
'testcontroller', :action => 'change_status'}, :with => 'value' %>
<div id="balance_div" style="display:none">
  <p>
    <b>Remaining Balance</b>
    <%= f.text_field :balance %>
  </p>
</div>

No when I first load this page, I need the change_status method hit on
my controller. It's only hit if I actually change the "guarantee_status"
field.

here's the method in my controller:

def change_status
    if request.xhr?
      render :update do |page|
        if params[:value].blank? || params[:value] == 'Due'
          page[:balance_div].hide
        else
          page[:balance_div].show
        end
      end
    end
  end
-- 
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]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to