Question

I'm using layout to make all actions to render :main layout:

class Pages < E

  layout :main

  # actions that using layout

  # pager should not use layout
  def pager

  end
end

How to exclude pager from the list of actions that using layout?

I understand i can use this:

  setup :action_1, :action_2 do
    layout :main
  end

But when i have lot of actions it becomes hairy.

Était-ce utile?

La solution

You should set layout to false to disable it.

For your case use this:

setup :pager do
  layout false
end

Perhaps not really intuitive but it is done like this to avoid redundant options like exclude, except, only etc.

You also can skip setup and use render_partial:

  def pager
    render_partial # or render_p
  end
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top