こんばんは
Railsでviewを作成している時に、helperからlink_toを使いたい時って結構あるのではないかと思います。
やり方は簡単です。
module ExampleHelper def example(word) link_to word, 'https://www.google.co.jp/', target: "_blank" end end
これでhelperからlink_toが使えるようになりました。
– Bucket of cotegg –
投稿日:
こんばんは
Railsでviewを作成している時に、helperからlink_toを使いたい時って結構あるのではないかと思います。
やり方は簡単です。
module ExampleHelper def example(word) link_to word, 'https://www.google.co.jp/', target: "_blank" end end
これでhelperからlink_toが使えるようになりました。
執筆者:asakos
関連記事
【ionic】リリースする!ちょっとその前に(version指定)
どうも、中田です。 ionic便利ですよね。 コマンド一つでマルチプラットフォー …
Webページまるごと画面キャプチャできるChromeの拡張機能「Full Page Screen Capture」
こんにちは。たなかです。 先日、チームのメンバーにスマホデザインのスクリーンショ …
[Bitbucket] fatal: Could not read from remote repository.
どうも中田です こないだリモートリポジトリにPushできないんすけど〜という話を …
2020/05/31
【Angular】component.htmlをprettierで整形する
2020/05/24
【Angular】Full calendarで横スクロールを実装
2020/05/10
document.querySelectorで色々なDOMを取得する
2020/05/09
Quarantine Improvement: Creating Anything