Вопрос

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.

Это было полезно?

Решение

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
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top