In a Rails 4 app I am trying to set the layout to false or nil. I tried this from inside my controller:
render :layout => false
But that gives this error:
undefined method `render'.
How can I stop this controller from using the default layout file?
To disable layout for a controller:
class FooController < ApplicationController
  layout false
  ...
end
                        class FoosController < ApplicationController
   layout false  ## Note it is not within any action
   def create
   ...
   end
...
end
class FoosController < ApplicationController
  ...
  def show
   ...
   render layout: false
  end
  ...
end
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With