Re: [Rails] Re: Rails passing params in link_to how to make it secure

2015-08-16 Thread prionko
Nilay, Why did u use Feed and FeedLike model? The solution provided by Liz is good. You can pass binary values for updating the like and dislike value, instead of having two different models. And definitely your code needs lot of cleanups. Google for code cleanups, refactoring in rails. -Sau

Re: [Rails] Re: Rails passing params in link_to how to make it secure

2015-08-16 Thread Colin Law
On 16 August 2015 at 04:27, nilay singh wrote: > I solve the issue Do you think it might be good manners to thank those that provided helpful ideas? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group a

Re: [Rails] Re: Rails passing params in link_to how to make it secure

2015-08-15 Thread nilay singh
Sure for my first question I made some changes to my routes file here I use resources for my model which generated the routes and then I write this code in link : This is what I change in route : resources :feed_likes, param: :feed_id and this is my links which I am passing the params : it is

Re: [Rails] Re: Rails passing params in link_to how to make it secure

2015-08-15 Thread Elizabeth McGurty
Would you kindly share your results? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group,

Re: [Rails] Re: Rails passing params in link_to how to make it secure

2015-08-15 Thread nilay singh
I solve the issue On Aug 16, 2015 8:56 AM, "Elizabeth McGurty" wrote: > Nilay, > > What's the status of your effort here? > > Liz > > On Monday, August 10, 2015 at 3:36:52 PM UTC-4, nilay singh wrote: >> >> I am trying to create a like and dislike function inside rails for that I >> am using lin_

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-15 Thread Elizabeth McGurty
Nilay, What's the status of your effort here? Liz On Monday, August 10, 2015 at 3:36:52 PM UTC-4, nilay singh wrote: > > I am trying to create a like and dislike function inside rails for that I > am using lin_to helper to pass params but there is an issue when ever > someone tries to copy p

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-12 Thread Frederick Cheung
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 t

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-11 Thread paul h
Hi Nilay, Ruby and Rails are changing all the time, so it's always useful to post which versions you are using, if I missed it in your post I apologise. On Tuesday, August 11, 2015 at 7:03:24 PM UTC+1, nilay singh wrote: > > Thanks for reply paul . If you can suggest me how should I use these >

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-11 Thread nilay singh
Thanks for reply paul . If you can suggest me how should I use these controllers code in model I am new to rails so I am not aware about this method . And for this problem I found a way to delay the process using disable_with method in rails and it fix the problem by delaying the process . S

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-11 Thread paul h
Hi Nilay, The first thing I would do, would be to strip out your controller code and move your logic into the model. You've got too much going on in your create and destroy actions. This should be in the model. The controller should be responsible for receiving the request, and sending the res

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-10 Thread Elizabeth McGurty
Okay, if I understand This is what I suggest you do: Like vs. dislike is a binary: true /false, yes / no, 1 / 0 . So you should be capturing this value as a binary with a checkbox, or something like that -- you could use a fancy button.. Drop your separate like and dislike fields in your

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-10 Thread nilay singh
http://ec2-52-6-228-48.compute-1.amazonaws.com/ Here is the live application I am working on here there is a like button when I click on like button it update my database that it liked and dislike button appear it work well but when I click very fast 3 times before dislike appear it sneds three

[Rails] Re: Rails passing params in link_to how to make it secure

2015-08-10 Thread Elizabeth McGurty
Pretty sure that this is an easy fix, but before I offer would you please clarify: "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 ur