On Monday, August 10, 2015 at 8:36:52 PM UTC+1, nilay singh wrote:
>
> And my routes is like :
>
>    get "/feed_likes/:feed_id/feed_likes/:user_id" => "feed_likes#destroy"
>       post "/feed_likes/:feed_id/feed_likes/:user_id" => "feed_likes#create"
>
> Here the issue is whenever someone wants to like the feed when I passes 
> the url direclty it updated the database how can I restrict this only when 
> user click the button only then it update the database not by url :
>
>
>
You shouldn't be doing something that changes the database from a GET 
route. I'd change that route to use the delete method instead of get (and 
then change the link too)

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/93109349-748c-4b34-85ee-a87eb1012a71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to