こんばんは
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
関連記事
【Angular】component.htmlをprettierで整形する
こんにちは 今回はcomponent.htmlをprettierで整形する方法を …
ActiveRecord::Relationのklassメソッドでmodelを取得できる。
こんにちは。コーテッグのこやまです。 モデルに対してallやwhereメソッドを …
【Rails】El Captain で’$rails s’ が動かない件
どうも中田です。 開発用MacをEl Capitanにアップデートしたところ r …
【gem/bundle】あんたたち一体どういう関係なのよ!!
どうも中田です。 今回はgemとbundleの話。 前置き よくあるgemの説明 …
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