Reputation: 14504
I get an error in view that says that I cannot double render.
My controller:
def index
@title = 'asdsadas'
@kategoris = Tag.all
render 'admin/kategoris/index'
respond_to do |format|
format.html
format.json { render :json => @kategoris }
end
end
How should I rewrite my action, to not double rendering?
Upvotes: 0
Views: 810
Reputation: 2476
def index
@title = 'asdsadas'
@kategoris = Tag.all
respond_to do |format|
format.html { render 'admin/kategoris/index' }
format.json { render :json => @kategoris }
end
end
Upvotes: 5