I have application.html.erb in app/views/layouts directory.
application.html.erb
if @condition
<%= yield %>
end
index.html.erb in app/views/item directory
<% @value.id %>
item_controller.rb
def index
@value = nil
if @condition
@value = my_value
end
respond_to do |format|
format.html
end
end
if @condition is false /localhost:3000/item render error that @value is nil. Why? I don't have layout file for item and if @condition is true, it works okay.
Is index.html.erb checked even though application.html.erb does not yield?