Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

defining initialize for a controller causes that no layout is rendered

#4771

Defining initialize for a controller causes that no layout is rendered, except it is passed as option for render. It is probably not intended (filters), but was possible in Rails 2.

class EntriesController < ApplicationController
  layout 'some_layout' # or 'application' or none

  def initialize
    :blubb
  end

  # does not work:
  def show
  end

  def index
    render :action => 'index'
  end

  # does work
  def new
    render :action => 'new', :layout => 'some_layout'
  end

  # ...

Reported by Jan Lelis · June 4th, 2010 @ 10:44 PM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Ryan Bigg
    Ryan Bigg
    • State changed from new to wontfix

    initialize is an important method for controllers in Rails 3. Do not override this method.

    June 5th, 2010 @ 04:15 AM