Rails and modal jquery dialog form

后端 未结 2 1379
轻奢々
轻奢々 2020-12-24 03:43

I\'m new to using jquery modal dialog boxes with rails and was wondering how I can :

  1. show a jquery modal dialog box with 1 field (eg \"title\")
  2. post t
2条回答
  •  时光说笑
    2020-12-24 04:25

    Here's an example of how I'd do it: https://github.com/ramblex/modal-form.

    You should be able to:

    1. download the app
    2. run bundle
    3. rake db:migrate
    4. rails s
    5. Go to localhost:3000/articles and the modal form should come up when you click on the 'New article' link.

    An error message should be shown when the title field is left empty. Otherwise it should create the article and display it.

    Hope it helps.

提交回复
热议问题