Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 ajax call - ActionView::MissingTemplate

I am trying to make an ajax call but I don't want to return any data, or perhaps only return a 200.

My error is

ActionView::MissingTemplate (Missing template ....

My ajax method in the controller is...

# Ajax
def updatePlayStat()
    #do something
    render :layout => false
end

Is there a way to tell rails to return nothing, without creating an extra template file?

BTW i am making the ajax call by using jquery's $.post method in a js file.

like image 881
HelloWorld Avatar asked Nov 28 '22 07:11

HelloWorld


1 Answers

You can render nothing with:

render :nothing => true

See: http://guides.rubyonrails.org/layouts_and_rendering.html#using-render

like image 117
jordanpg Avatar answered Dec 09 '22 17:12

jordanpg