I have a select in a partial (_partialInPartial) , which itself is in a partial (_partial). _partialInPartial contains a select. WIthin the select, I have :selected = > nil so that there is nothing selected. When I redraw it, I therefore expect that nothing will be selected in it. However, when I render :partial => ''_partialInPartial'' it is still retaining the previously selected value Is this because it is a partial within a partial? If so, how can I get around this to make certaian a select in a partial is always set to, in effect, un-selected? Thanks, RVince
2009/8/28 RVince <rvince99-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>:> > I have a select in a partial (_partialInPartial) , which itself is in > a partial (_partial). > > _partialInPartial contains a select. WIthin the select, I > have :selected = > nil so that there is nothing selected. When I > redraw it, I therefore expect that nothing will be selected in it. > > However, when I render :partial => ''_partialInPartial'' it is still > retaining the previously selected valueWhen you say ''redraw'' do you mean go back to it in the browser or is it a fresh render from the server. If the former then it is the browser keeping the previous selection not your application. View the source in the browser to see if your selected => nil is getting through correctly. Colin> > Is this because it is a partial within a partial? If so, how can I get > around this to make certaian a select in a partial is always set to, > in effect, un-selected? Thanks, RVince > > >
Colin, I think what I am asking is, should a redraw of a partial be the equivalent of a refresh of that partial only? (and if so, would that hold for a partial in a partial, or is that considered bad form in the rails world?) -RVince On Aug 28, 10:56 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/28 RVince <rvinc...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>: > > > > > I have a select in a partial (_partialInPartial) , which itself is in > > a partial (_partial). > > > _partialInPartial contains a select. WIthin the select, I > > have :selected = > nil so that there is nothing selected. When I > > redraw it, I therefore expect that nothing will be selected in it. > > > However, when I render :partial => ''_partialInPartial'' it is still > > retaining the previously selected value > > When you say ''redraw'' do you mean go back to it in the browser or is > it a fresh render from the server. If the former then it is the > browser keeping the previous selection not your application. View the > source in the browser to see if your selected => nil is getting > through correctly. > > Colin > > > > > Is this because it is a partial within a partial? If so, how can I get > > around this to make certaian a select in a partial is always set to, > > in effect, un-selected? Thanks, RVince