Hey everyone. I''m using a partial 3 times in my applications.html.erb file. When the index is loaded everything works exactly like it should. (the partial contains a collection_select with prompts). If i goto the show action the options for the collection select seem to vanish. IE no prompt when rendered. I''ve removed everything from the show.html.erb and def show action just incase there was some sort of run in. But there isn''t, it seems to just be a rendering problem. Any ideas? The partial: Select <%= box %>: <%= collection_select("vehicle", box, list, box, box, {:prompt => "Search by #{box}", :selected => selected }, {:onchange => "#{remote_function(:url => {:action => "update_dropdowns"}, :with => "''current_id=''+id+ ''¤t_value=''+value+ ''&fields=''+ ''year=''+$(vehicle_year).value+'',''+ ''make=''+$(vehicle_make).value+'',''+ ''model=''+$(vehicle_model).value")}"}) %> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
So it turns out it''s not just the partial. Any dropdown select i ad to that page will not properly display :prompt. Now I have an ajax update method so If i change the select all selects are reloaded. And as soon as I change one they all act accordingly with prompt displayed properly. So it seems only the inital page load is messing up the rendering. Anyone have any ideas? Even a method to force reload that container on load so it would properly adjust would be decent. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 February 2010 23:19, brianp <brian.o.pearce-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So it turns out it''s not just the partial. Any dropdown select i ad to > that page will not properly display :prompt. Now I have an ajax update > method so If i change the select all selects are reloaded. And as soon > as I change one they all act accordingly with prompt displayed > properly. > > So it seems only the inital page load is messing up the rendering.Two suggestions, firstly have a look at the html of the page (View, Page Source, or similar, in browser) and see if the prompt is there. If it is then copy and paste the code into the w3c html validator at http://validator.w3.org/#validate_by_input and see if there are any errors. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey Colin, thanks for the reply. I did think to check for that and un-fortunately the html for the prompt (first <option>) is not generated at all. It immediately skips to the first object in the list, just as if the prompt wasn''t there at all. On Feb 8, 1:43 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 7 February 2010 23:19,brianp<brian.o.pea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > So it turns out it''s not just the partial. Any dropdown select i ad to > > that page will not properly display :prompt. Now I have an ajax update > > method so If i change the select all selects are reloaded. And as soon > > as I change one they all act accordingly with prompt displayed > > properly. > > > So it seems only the inital page load is messing up the rendering. > > Two suggestions, firstly have a look at the html of the page (View, > Page Source, or similar, in browser) and see if the prompt is there. > If it is then copy and paste the code into the w3c html validator athttp://validator.w3.org/#validate_by_inputand see if there are any > errors. > > Colin-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Just found my problem. <%= collection_select(:Vehicle, box, list, box, box, I previously had :vehicle. Which I''m assuming wasn''t actually being recognized as Model type due to case. Weird that it still functioned on the index but broke on the show. Either way it works now. Weird little glitch I guess. I could understand if it didn''t work at all lol. Thanks for the suggestion Colin! On Feb 9, 12:07 am, brianp <brian.o.pea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey Colin, > thanks for the reply. > > I did think to check for that and un-fortunately the html for the > prompt (first <option>) is not generated at all. It immediately skips > to the first object in the list, just as if the prompt wasn''t there at > all. > > On Feb 8, 1:43 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > On 7 February 2010 23:19,brianp<brian.o.pea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > So it turns out it''s not just the partial. Any dropdown select i ad to > > > that page will not properly display :prompt. Now I have an ajax update > > > method so If i change the select all selects are reloaded. And as soon > > > as I change one they all act accordingly with prompt displayed > > > properly. > > > > So it seems only the inital page load is messing up the rendering. > > > Two suggestions, firstly have a look at the html of the page (View, > > Page Source, or similar, in browser) and see if the prompt is there. > > If it is then copy and paste the code into the w3c html validator athttp://validator.w3.org/#validate_by_inputandsee if there are any > > errors. > > > Colin > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.