LoginSignup
0
0

More than 1 year has passed since last update.

Rails 6.1 でview を色んな場所でrender する

Last updated at Posted at 2021-07-02

app/users/index.csv.ruby をrender する場合は下記の様なコードを書く。
どこからでも呼べる

args = { users: User.all } # index.csv.ruby で @users でアクセスができる
ActionController::Base.renderer.render(template: "users/index", formats: [:csv], assigns: args)
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