On 7 July 2015 at 06:38, Faizan Ali <[email protected]> wrote:
> I have a model let's say Student and I want to edit a row in the table
> name students through Ajax after clicking a button, what is the correct
> way to do this? Also, please note I want to edit value inside one column
> followers
>
> Here is the js code:
>
>     $(document).ready(function(){
>     $('.clap').click(function(){
>         var dataString = "student[followers]=5";
>          $.ajax({
>                 type: "POST",
>                 url: "/students/",
>                 data: dataString,
>                 success: function() {
>                   window.alert('success');
>                   }
>               });
>     });
> });

Not sure what you are asking.  Are you asking how to perform the
action in the controller when it receives the POST?  If not then
please try to explain again exactly what the question is.  Also say
what you have already tried.

Colin

-- 
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/CAL%3D0gLv2rFdJ7uahVmEhHXmeQbdrO22%3D7uEGBMk0QFH5Ny1i-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to