Not sure why this is happening. In my index.rhtml is a form with instance variable for colleciton_selects. So in the controller - @categories = Category.find(:all, :order => "name") Now I''ve changed the index.rhtml to _index.rhtml and all of a sudden I''m getting nil.inject errors. _index should still be part of the same action so why not seeing them ? TIA Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/19/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Not sure why this is happening. > > In my index.rhtml is a form with instance variable for colleciton_selects. > > So in the controller - > > @categories = Category.find(:all, :order => "name") > > Now I''ve changed the index.rhtml to _index.rhtml and all of a sudden I''m > getting nil.inject errors. > _index should still be part of the same action so why not seeing them ? > > TIA > StuartStuart, Can you include your code for you index method and also the relevant part of the index view. Cheers --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Oct-18 16:29 UTC
Re: Losing arrays with partial
Controller def index @categories = Category.find(:all, :order => "name") @states = State.find(:all, :order => "name") @terms = Term.find(:all, :order => "name") @positions = Position.find(:all, :limit => 0) end view: <% content_for ''formside'' do -%> <h1>New search</h1> <% end -%> <div id="parta"> <form id="asearch"> <fieldset><legend>Category</legend> <select name=category_id[] size="4" multiple = "multiple" id ''cat''><%options_from_collection_for_select @categories, :id, :name, :prompt => true %></select></fieldset> <fieldset><legend>State</legend> <select name=state_id[] size="4" multiple = "multiple" id = ''stat''><%options_from_collection_for_select @states, :id, :name %></select></fieldset> <fieldset><legend>Terms</legend> <select name=term_id[] size="4" multiple = "multiple" id = ''term''><%options_from_collection_for_select @terms, :id, :name %></select> Stuart --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Hi Stuart, If you''re rendering a partial, you should have a line that looks like "<%= render :partial=>''index'' %>. You probably know that, but I didn''t see it in the code you included. One mistake that I''ve found it easy to make is to think that one template is being rendered, when another one is instead. Cheers Starr --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Oct-18 18:59 UTC
Re: Losing arrays with partial
Sorry for the confusion. Acutally by the time I posted the code I had gone back to the regular template. It was in there though when I ran into these problems Stuart --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---