I do not know why this happens but for a few hours I have been struggling with this problem that I really do not know how to solve.
Here is my link_to:
<%= link_to "sign_out",sign_out_path, method: :delete %>
My route:
delete 'sign_out' => 'sessions#destroy'
My method in the controller:
def destroy
session[:omniauth] = nil
session[:user_id] = nil
redirect_to root_path
end
application.js
//= require jquery
//= require jquery.turbolinks
//= require jquery_ujs
//= require bootstrap.min
//= require bootstrap
//= require owl.carousel.min
//= require bootstrap-sprockets
//= require jquery.slick
//= require turbolinks
//= require_tree .
I also get this error from application.js:
Uncaught Error: ExecJS::ProgramError: Unexpected token: punc ()) (line: 11813, col: 10, pos: 494768)
Error
at new JS_Parse_Error (/tmp/execjs20160226-19-14k25i3js:2357:10623)
at js_error (/tmp/execjs20160226-19-14k25i3js:2357:10842)
at croak (/tmp/execjs20160226-19-14k25i3js:2357:19067)
at token_error (/tmp/execjs20160226-19-14k25i3js:2357:19204)
at unexpected (/tmp/execjs20160226-19-14k25i3js:2357:19292)
at /tmp/execjs20160226-19-14k25i3js:2357:20761
at /tmp/execjs20160226-19-14k25i3js:2357:19938
at block_ (/tmp/execjs20160226-19-14k25i3js:2357:24557)
at ctor.body (/tmp/execjs20160226-19-14k25i3js:2357:24191)
at function_ (/tmp/execjs20160226-19-14k25i3js:2357:24256)
(in /app/app/assets/javascripts/application.js)
And the error says that the page does not exist.