form_remote_tagã®ã‚ªãƒ—ション
- :update
- æ›´æ–°ã—ãŸã„idを指定ã™ã‚‹
- (:update => 'my_id')
- :url
- url_forã«æŒ‡å®šã™ã‚‹ãƒ‘ラメータã¨åŒã˜
- (:url => {:action => 'create'})
- :failure
- 失敗ã—ãŸã¨ãã®ã‚¢ã‚¯ã‚·ãƒ§ãƒ³
- (:failure => "alert('失敗')")
- :complete
- æˆåŠŸã—ãŸã¨ãã®ã‚¢ã‚¯ã‚·ãƒ§ãƒ³
- (:complete => "alert('æˆåŠŸ')")
- :position
- HTML ã®æ–片を挿入ã•ã‚Œã‚‹ä½ç½®
- (:position => 'top')
- :html
- HTMLã®å±žæ€§
- (:html => {:id => 'tag_id', :class => 'remote'})
サンプル
<%= form_remote_tag(:update => 'my_id', :url => {:action => 'create'}, :failure => "alert('失敗')", :complete => "alert('æˆåŠŸ')", :position => 'top', :html => {:id => 'tag_id', :class => 'remote'}) %> <%= text_field("book", "author") %> <%= submit_tag "Ajax" %> <%= end_form_tag %>