LoginSignup
20
13

More than 1 year has passed since last update.

railsのlink_toでjavascript:voidやonclickを使う方法

Last updated at Posted at 2017-11-13

#はじめに
簡単な記述ですが忘れがちなので備忘として残します

#viewに以下のようにlink_toを記述します

= link_to('name', 'javascript:void(0);',onclick: "console.log(’test')")

以上!

20
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
13