Restrict application layout for certain views

Hi folks

Is there any way to change / restrict the application layout for certain
views?

For example, I don’t want to render the header for a certain view, is
there any code such as:

<% if View != show.html.erb%>
<%= render ‘layouts/header’ %>
<% end %>

Thanks in advance

Jason

You could just set some session variable at the point of controller =>
show. And test at your rendering. However, I think that you are better
off studying and learning methods associated with your Controller
middleware…
Liz

On Sat, Jul 25, 2015 at 3:44 PM, Jason W. [email protected]
wrote:

Is there any way to change / restrict the application layout for certain
views?

You can do that by specifying the layout in the controller. See:

http://guides.rubyonrails.org/layouts_and_rendering.html#the-layout-option

-Dave


Dave A., consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Dave A. wrote in post #1176892:

On Sat, Jul 25, 2015 at 3:44 PM, Jason W. [email protected]
wrote:

Is there any way to change / restrict the application layout for certain
views?

You can do that by specifying the layout in the controller. See:

http://guides.rubyonrails.org/layouts_and_rendering.html#the-layout-option

-Dave


Dave A., consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs