Error with link_to method delete in Ruby on Rails

1

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.

    
asked by David Bazzinga Juggling 26.02.2016 в 05:47
source

1 answer

1

The error was some javascript libraries that were no longer used in the project, so stop asking all the libraries in assets / javascript eliminating the following line of Application.js:

//= require_tree . 
    
answered by 26.02.2016 в 20:59