Ruby Rails - structuring data for AJAX call to controller action

后端 未结 2 550
野的像风
野的像风 2021-01-14 19:54

I have need for a button on my site which can send information to the create action of a controller (\"pagetimes\"). It seems to be working, although it is not sending all t

2条回答
  •  爱一瞬间的悲伤
    2021-01-14 20:25

    $.post( "/pagetimes/create", { pagename: "whatever", start: "7", end: "21"  })
    .done(function( data ) {
      alert( "Data Loaded: " + data );
    });
    

提交回复
热议问题