Ruby on Rails Tuesday, June 29, 2010

HI Bob,

On Mon, Jun 28, 2010 at 3:16 PM, Bob Smith <bsm2th@gmail.com> wrote:
> The problem is
> that this is the page is to edit an existing record also, so
> observe_field needs to see that the zip code currently doesn't match,
> so the church list needs to be shown. Currently, even if the zip
> doesn't match, the list will only be shown after the field is changed,

For the initial page load you just need to test and render if
appropriate on the initial page load.

<div id="church">
<% if @household.zip != xxxxx and @household.zip != yyyyy %>
<%= render :partial => "church_select %>
<% end %>
</div>

You need to change the render :nothing in your controller to render an
empty string or partial to empty the content of the church div when
appropriate.

HTH,
Bill

--
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.

No comments:

Post a Comment