LoginSignup
0
0

More than 1 year has passed since last update.

Prefix_pathに引数を入れる理由

Posted at

こんにちは!テックアカデミーのWebアプリコースを受講している駆け出し高校生エンジニアの安田駿介です。

今回は、「Ruby <%= %>内でstyle要素を書く方法」というテーマで解説していきます。

Prefix_pathに引数を入れる理由

結論を言うと、Prefix_pathで呼び出すURLに、引数の内容を補足するためです。

例えば、
cc3b604c13ba618ca6b9889defddc205.png
というコードがあったとします。

このコードの意味は、「作成したレコード一覧のページを表示する」です。

これに(current_user)という引数を指定すると、

eb824e503c0e4a3b5d5f53b53d71903d.png

「ログインしているユーザの作成したレコード一覧」という意味になります。

開発環境

・Cloud9
・Ruby 3.0.0
・Rails 6.1.3.1

0
0
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
0
0