Answers for "$.ajax how to read data vale in controller in rails"

0

$.ajax how to read data vale in controller in rails

def test
  some_parameter = params[:some_parameter]
  # do something with some_parameter and return the results

  @test=books.find.last
  respond_do |format|
    format.html
    format.json {render json: @test}
  end
end
Posted by: Guest on May-06-2020
0

$.ajax how to read data vale in controller in rails

$.ajax({
  type:"GET",
  url:"books/test",
  dataType:"json",
  data: {some_parameter: 'hello'},
  success:function(result){
    alert(result);
  }
})
Posted by: Guest on May-06-2020

Code answers related to "$.ajax how to read data vale in controller in rails"

Code answers related to "Javascript"

Browse Popular Code Answers by Language