Hello i would like a new vote with link_to , this my code <%= link_to(''rate it'', vote_url(:id => @faq.id, :score => 1), :html => { :method => :post }) %> Each time i am redirect to show method and not create method :( Can u help me ? Thanks -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Not sure if I''m giving you the right answer but according to this little chart orders_url /posts GET index orders_url /posts POST create order_url /posts/:id GET show order_url /posts/:id PUT update order_url /posts/:id DELETE destroy new_order_url /posts/new GET new edit_order_url /posts/:id;edit GET edit it looks like you should be doing a GET to new. At least that is how I''ve found it to work new goes into create. No it''s not the best explanation. Hope it helps. Stuart On 10/12/06, Bolo <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hello > > i would like a new vote with link_to , this my code > <%= link_to(''rate it'', vote_url(:id => @faq.id, :score => 1), :html => { > :method => :post }) %> > > Each time i am redirect to show method and not create method :( > > Can u help me ? > > > Thanks > > -- > Posted via http://www.ruby-forum.com/. > > > >-- 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 -~----------~----~----~----~------~----~------~--~---
Hello Dark>it looks like you should be doing a GET to new.At least that is how I''ve found it to work new goes into create. No it''s not the best explanation. don''t really understand your explanation.:( And i don''t want to do a Get but a POST with a link_to --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bolo, I believe you have your attributes wrong. Try this: <%= link_to ''rate it'', vote_url(:id => @faq.id, :score => 1), :post => true %> I am concerned about your faq.id being sent as the id... shouldn''t it be :faq_id => @faq.id if you are trying to create a new vote object? On 10/12/06, Bolo <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hello > > i would like a new vote with link_to , this my code > <%= link_to(''rate it'', vote_url(:id => @faq.id, :score => 1), :html => { > :method => :post }) %> > > Each time i am redirect to show method and not create method :( > > Can u help me ? > > > Thanks > > -- > 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-/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/12/06, Bolo <malavoi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hello Dark > > >it looks like you should be doing a GET to new. > At least that is how I''ve found it to work new goes into create. No > it''s > not the best explanation. > > don''t really understand your explanation.:( > And i don''t want to do a Get but a POST with a link_toOkay, here is the link to what I posted: http://david.goodlad.ca/articles/2006/08/02/simply_restful-in-rails-core It will help you understand the routes better. 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 -~----------~----~----~----~------~----~------~--~---
hello Carl, try your code <%= link_to ''rate it'', vote_url(:faq_id => @faq.id, :score => 1), :post => true %> This link redirect me here (show method and not create method) http://localhost:3000/votes/41?faq_id=41&score=1 :( --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bolo, I don''t know why you are continuing to use post. It''s not the right method. Stuart On 10/12/06, Bolo <malavoi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > hello Carl, > > try your code > <%= link_to ''rate it'', vote_url(:faq_id => @faq.id, :score => 1), :post > => true %> > > This link redirect me here (show method and not create method) > http://localhost:3000/votes/41?faq_id=41&score=1 > :( > > > > >-- 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 -~----------~----~----~----~------~----~------~--~---
Did it redirect you? IE It created your vote and then redirected you to show? Or did it just send you to show? Please post the entire contents of the link tag. Also, what is the correct URL you are aim for? On 10/12/06, Bolo <malavoi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > hello Carl, > > try your code > <%= link_to ''rate it'', vote_url(:faq_id => @faq.id, :score => 1), :post > => true %> > > This link redirect me here (show method and not create method) > http://localhost:3000/votes/41?faq_id=41&score=1 > :( > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart, He is trying to CREATE something, so POST is definitely the way to go. You don''t want votes to be created by some web crawler or some crazy Google Caching tool do you? The URL that is generated by the link_to has the params in the URL but I it is not working for some reason. Carl On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Bolo, I don''t know why you are continuing to use post. It''s not the right > method. > > Stuart > > On 10/12/06, Bolo < malavoi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > hello Carl, > > > > try your code > > <%= link_to ''rate it'', vote_url(:faq_id => @ faq.id, :score => 1), :post > > => true %> > > > > This link redirect me here (show method and not create method) > > http://localhost:3000/votes/41?faq_id=41&score=1 > > :( > > > > > > > > > > -- > 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/12/06, Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Stuart, > > He is trying to CREATE something, so POST is definitely the way to go. > You don''t want votes to be created by some web crawler or some crazy > Google Caching tool do you? > > The URL that is generated by the link_to has the params in the URL but > I it is not working for some reason. > > Carl > > > Thanks Carl, I was going by the list of the 7 methods / routes. I guessI''m wrong. 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 -~----------~----~----~----~------~----~------~--~---
Ok, I just asked Rick Olson (core member) and he said this won''t work/isn''t supported. Primarily because it isn''t really ''RESTful''. But that doesn''t mean you can''t go old school on it and do it that way. So create an add_vote method and grab the params and go on about your day. But still use the :post => true for the reasons I explained to Stuart. On 10/12/06, Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Stuart, > > He is trying to CREATE something, so POST is definitely the way to go. > You don''t want votes to be created by some web crawler or some crazy > Google Caching tool do you? > > The URL that is generated by the link_to has the params in the URL but > I it is not working for some reason. > > Carl > > On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Bolo, I don''t know why you are continuing to use post. It''s not the right > > method. > > > > Stuart > > > > On 10/12/06, Bolo < malavoi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > hello Carl, > > > > > > try your code > > > <%= link_to ''rate it'', vote_url(:faq_id => @ faq.id, :score => 1), :post > > > => true %> > > > > > > This link redirect me here (show method and not create method) > > > http://localhost:3000/votes/41?faq_id=41&score=1 > > > :( > > > > > > > > > > > > > > > > > -- > > 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 -~----------~----~----~----~------~----~------~--~---
Stuart... I don''t think you were wrong at all. If you are trying to get to the form to enter data (which is ''new''), then you are correct. However, if you are trying to actually create the object from the link, then you would want to go this other route. Who knows what Mr. Bolo wants :-) On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/12/06, Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Stuart, > > > > He is trying to CREATE something, so POST is definitely the way to go. > > You don''t want votes to be created by some web crawler or some crazy > > Google Caching tool do you? > > > > The URL that is generated by the link_to has the params in the URL but > > I it is not working for some reason. > > > > Carl > > > > > > > Thanks Carl, I was going by the list of the 7 methods / routes. I guess I''m > wrong. > 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 -~----------~----~----~----~------~----~------~--~---
Thanks Carl! I''m far from a rest initiate, even though I took the plunge to make my app as restful as possible. Good to know about the link , sure at some point I''ll need it :) Stuart On 10/12/06, Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Stuart... I don''t think you were wrong at all. If you are trying to > get to the form to enter data (which is ''new''), then you are correct. > However, if you are trying to actually create the object from the > link, then you would want to go this other route. Who knows what Mr. > Bolo wants :-) > > On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 10/12/06, Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Stuart, > > > > > > He is trying to CREATE something, so POST is definitely the way to go. > > > You don''t want votes to be created by some web crawler or some crazy > > > Google Caching tool do you? > > > > > > The URL that is generated by the link_to has the params in the URL but > > > I it is not working for some reason. > > > > > > Carl > > > > > > > > > > > Thanks Carl, I was going by the list of the 7 methods / routes. I guess > I''m > > wrong. > > 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 -~----------~----~----~----~------~----~------~--~---
Yeh boys 1. i am girl :) 2. i would like a create a object form link Ok, I just asked Rick Olson (core member) and he said this won''t work/isn''t supported. Primarily because it isn''t really ''RESTful''. But that doesn''t mean you can''t go old school on it and do it that way. So create an add_vote method and grab the params and go on about your day. But still use the :post => true for the reasons I explained to Stuart. Okidoki Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you take the old school route you will be allowing delete operation by manipulating the URL right? --- Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Ok, I just asked Rick Olson (core member) and he said this won''t > work/isn''t supported. Primarily because it isn''t really ''RESTful''. But > that doesn''t mean you can''t go old school on it and do it that way. So > create an add_vote method and grab the params and go on about your > day. But still use the :post => true for the reasons I explained to > 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 -~----------~----~----~----~------~----~------~--~---
Bala, No. By ''old school'' I mean that you create a method that has very specific functionality and does not directly map to CRUD. Carl On 10/13/06, Bala Paranj <bparanj-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > If you take the old school route you will be allowing delete operation by manipulating the URL > right? > > --- Carl Fyffe <carl.fyffe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Ok, I just asked Rick Olson (core member) and he said this won''t > > work/isn''t supported. Primarily because it isn''t really ''RESTful''. But > > that doesn''t mean you can''t go old school on it and do it that way. So > > create an add_vote method and grab the params and go on about your > > day. But still use the :post => true for the reasons I explained to > > 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 -~----------~----~----~----~------~----~------~--~---