こんばんは
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
関連記事
[Xcode] The executable was signed with invalid entitlements. でアプリを実機確認できない!
こんにちは。たなかです。 作ったiOSアプリを実機確認したくて、Xcodeからデ …
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