Is there a way in ruby to bypass application.html.erb but still use the corresponding view of the controller?
Right now I have
render :layout => false
But I get the following error from the view:
undefined method `each' for nil:NilClass
Below is my current posts controller:
class PostsController < ApplicationController
def index
@posts = Post.where('is_deleted' => false, 'is_hidden' => false).limit(15).order('created_at DESC')
end
def show
@posts = Post.find(params[:id], :conditions => 'is_deleted = false')
end
def page
render :layout => false
@posts = Post.where('is_deleted' => false, 'is_hidden' => false).limit(15).offset(params[:page].to_i * 15).order('created_at DESC')
end
end
should be