My problem is similar to the problem in this question, but vice versa. How to specify ": ββlayout => false" in Rails' response_with?
A controller is a kind of file converter. It responds to many formats. One format is to display an html layout displaying metadata. This format requires a layout to be displayed, unlike most other formats. The problem is that I cannot convince Rails to render it.
class CustomFilesController < ApplicationController respond_to :all, :only => :show def show @custom_file = CustomFile.find(params[:id]) respond_with(@custom_file) do |format| format.html {} format.xml {} format.json {} format.fil { puts '>>>>> IN FIL <<<<<' render :layout => true } format.any { file = @custom_file.as(:type => params[:format], :size => params[:size])
I thought that ": layout => true" would work, but apparently not.
As you can see, I removed everything else in the controller before inserting it here. The "fil" format is added to the mime types as text / html format in config / initializers / mime_types.rb. I have a file for viewing in place, and it displays, but without a layout.
I would be grateful for any advice. I am not going anywhere, and everything that I find on the Internet suggests that my code should work.
Thanks in advance.
source share