
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Submit form using link_to in rails
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Submit form using link_to in rails
I'm trying to submit a form using link_to as follows: <%= form_for(@post, :url=> '/post/action', ... I'm trying to submit a form using link_to as follows: <%= form_for(@post, :url=> '/post/action', :method=> 'post', :html => {:id=>'form_id'} ) do |f| %> .... <%= link_to 'submit', "/post/action", :onclick=>"document.getElementById('form_id').submit()" %> .... but it is not posting the form, it is simply redirecting my form to the specified url. Does anyone know how to do this?