I think routes are messing up data that I am trying to pass between showing a product and entering a review. In the product/show view I have: <%= link_to ''Add a Review'', new_review_path, :xyz => @product.id %> Inspecting the params of review/new there is nothing but {"action"=>"new", "controller"=>"reviews"} -- Then again, I could be way off in the original link_to statement. The code is pretty much stock stuff. Any ideas? --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
<%= link_to ''Add a Review'', new_review_path(@product, :xyz => @product.id) %> On Sun, Mar 30, 2008 at 8:09 AM, Sunny Beach <sunnybeach1999-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think routes are messing up data that I am trying to pass between > showing a product and entering a review. > > In the product/show view I have: > > <%= link_to ''Add a Review'', new_review_path, :xyz => @product.id %> > > Inspecting the params of review/new there is nothing but {"action"=>"new", > "controller"=>"reviews"} > > -- > > Then again, I could be way off in the original link_to statement. > > The code is pretty much stock stuff. > > Any ideas? > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
bala kishore pulicherla wrote:> > <%= link_to ''Add a Review'', new_review_path(@product, :xyz => > @product.id) %>I can''t see the routes.rb, but ain''t that just new_review_path(@product.id) ? -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, I got it to work with the following: In the view sending the params information: <%= link_to ''Add a Review'', new_review_path(:product => @product.id)%> In the view receiving the params information and passing it to the controller. <%= f.hidden_field :product_id, :value => params[:product]%> On Sat, Mar 29, 2008 at 10:46 PM, bala kishore pulicherla < balumca21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > <%= link_to ''Add a Review'', new_review_path(@product, :xyz => @product.id) > %> > > > > > > On Sun, Mar 30, 2008 at 8:09 AM, Sunny Beach <sunnybeach1999-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > I think routes are messing up data that I am trying to pass between > > showing a product and entering a review. > > > > In the product/show view I have: > > > > <%= link_to ''Add a Review'', new_review_path, :xyz => @product.id %> > > > > Inspecting the params of review/new there is nothing but > > {"action"=>"new", "controller"=>"reviews"} > > > > -- > > > > Then again, I could be way off in the original link_to statement. > > > > The code is pretty much stock stuff. > > > > Any ideas? > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
opz i forgot to post some thing in routes.rb map.resources :products.each do |product| product.resource :reviews end and in the view <%= link_to ''Add a Review'', new_product_reviews_path(@product,:product_d => @product.id)%> :) On Sun, Mar 30, 2008 at 8:45 AM, Sunny Beach <sunnybeach1999-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks, I got it to work with the following: > > In the view sending the params information: > <%= link_to ''Add a Review'', new_review_path(:product => @product.id)%> > > In the view receiving the params information and passing it to the > controller. > <%= f.hidden_field :product_id, :value => params[:product]%> > > > > On Sat, Mar 29, 2008 at 10:46 PM, bala kishore pulicherla < > balumca21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > <%= link_to ''Add a Review'', new_review_path(@product, :xyz => @ > > product.id) %> > > > > > > > > > > > > On Sun, Mar 30, 2008 at 8:09 AM, Sunny Beach <sunnybeach1999-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > > I think routes are messing up data that I am trying to pass between > > > showing a product and entering a review. > > > > > > In the product/show view I have: > > > > > > <%= link_to ''Add a Review'', new_review_path, :xyz => @product.id %> > > > > > > Inspecting the params of review/new there is nothing but > > > {"action"=>"new", "controller"=>"reviews"} > > > > > > -- > > > > > > Then again, I could be way off in the original link_to statement. > > > > > > The code is pretty much stock stuff. > > > > > > Any ideas? > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---