Rails submitting a form through ajax and updating the view

前端 未结 4 506
青春惊慌失措
青春惊慌失措 2020-12-15 11:10

I want to update a form submit through ajax without reloading the page and update the view according to it. I tried the different methods and failed as i m new to rails.

4条回答
  •  清歌不尽
    2020-12-15 12:05

    Try adding respond_to block in your controller action "create", and respective create.js.erb and put in your js that you want to get executed after the create action, and do post any error that you are getting on your browser console or rails server console, do that we can help you find where you are getting wrong

提交回复
热议问题