Ok so I have a show method that tries to render a layout and the show view renders a couple partials but I am getting a double render error in rails. How do I get it to render the layout and the partials? Note that it renders just fine with the default layout.
Here is my controller action
def show
@site = Site.find_by_subdomain!(request.subdomain)
@page = @site.pages.find_by_name('index')
render :layout => "layouts/mobile"
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @site }
end
end
And my view simply looks like this:
<%= render(:partial => "page", :object => @page) %>
Ok figured it out. Sorry for the post but I’ll answer it in case someone else has the problem. Basically at the top of my controller file I just needed this line: