Hello! From my home page you can choose a tire size your looking for this takes you to the tire_results page. now this page is built on what tires are in @tire. So you may be looking at all the 14" tires I have. But you will be looking at singles, pairs and sets. I would like my customers to be able to narrow down what there looking for like just find all the set of 4''s or all the pairs. From the home page a :id gets past to tire_results page... bringing back all those tires... how can I reuse this same page to render the :id tires and narrow it down to were t.qty ==''s 2 or 1 or what ever. -- 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 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.
You can just pass it into the view as a hidden param. -- 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.
Chris Habgood wrote in post #974783:> You can just pass it into the view as a hidden param.like a session variable or some thing? Well I was thinking that maybe I could build a route that went controller/action/id/qty So if :qty was absent it would use the general array of tires with that :id param and if :qty was present it would then delete all elements that didn’t meet the qty sent. Currently the @tires array gets built on were size equals :id. I’m not sure how to say if :qty != nil{ delete_if( |t| t.qty != :qty} -- 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 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.
<%= hidden_field_tag %> -- 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 Jan 14, 11:36 pm, Cameron Vessey <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Chris Habgood wrote in post #974783: > > > You can just pass it into the view as a hidden param. > > like a session variable or some thing?I''d avoid session variables.> > Well I was thinking that maybe I could build a route that went > controller/action/id/qty > So if :qty was absent it would use the general array of tires with that > :id param and if :qty was present it would then delete all elements that > didn’t meet the qty sent. >That is a nicer way of looking at things. It also means (unlike using a hidden form parameter) that people can link to that precise page, bookmark it etc.> Currently the @tires array gets built on were size equals :id. I’m not > sure how to say if :qty != nil{ delete_if( |t| > t.qty != :qty} >That''s pretty much exactly what you''d do (or you might want to add the condition on qty into what fetches tries from the database) Fred> -- > Posted viahttp://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 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.
Frederick Cheung wrote in post #975249:>> > That''s pretty much exactly what you''d do (or you might want to add the > condition on qty into what fetches tries from the database) > > FredThanks for letting me know I was on the right track. -- 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 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.