Question: I'm trying to render different partials into my index view from the controller, depending on the params I receive.
I have a simple unless-else condition inside my controller that checks the params

```
def index
 unless params[:check].nil?
  render :partial => /layout/check
 else
  render :partial => /layout/not_check
 end
end

```

And I have the files \_check.html.erb and not\_check.html.erb into the folder layout/

Now, how can I show that partials inside my index view?
At the moment I can just visualize the partial alone as a single view, but not inside the requested view.

Answer: 
The better way would be to call the partials from index.html.erb 

```
<% unless params[:check].nil? %>
  <%= render :partial => '/layout/check' %>
<% else %>
  <%= render :partial => '/layout/not_check' %>
<% end %>

```

so your def index would look like this

```
def index
  respond_to do |format|
    format.html
  end
end

```

I did not understand what you are trying to do but partial which are related to controller/actions should not be in layout unless they are serving some layout.
If you're trying to render a layout (and not actual view information) try using [render layout](http://guides.rubyonrails.org/layouts_and_rendering.html#using-render)

```
def index
  if params[:check].nil?
    render layout: "not_check"
  else
    render layout: "check"
  end
end

```