LoginSignup
0
0

More than 5 years have passed since last update.

ControllerやActionごとにレイアウトテンプレートの出し分け

Last updated at Posted at 2015-07-09

はじめに

ControllerやActionごとにレイアウトテンプレートを出し分けたいときTips
デフォルトではapp/views/layouts/application.html.erbが呼び出されます

Controller

class hogehoge < ApplicationController

  layout '呼び出したいテンプレート'

  def hogehoge
  end

end

Action

class hogehoge < ApplicationController

  def hogehoge
    render :layout => '呼び出したいテンプレート'
  end

end
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