Rails 6. SyntaxError: missing ) in parenthetical (UJS)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Rails 6. SyntaxError: missing ) in parenthetical (UJS)

nikolaokonesh

I use pagination ajax (kaminari and pagy gem), click more page not work. how it


Снимок экрана_2019-08-25_23-54-07.png

  var colum = document.querySelector("#categories_index");
  var pagin = document.querySelector("#categories_index_paginate");

  colum.innerHTML += ("<%= j render(partial: 'article/posts/post', collection: @posts, cached: true) %>");
  pagin.innerHTML = ("<%= render(partial: 'next_link') %>");

SyntaxError: missing ) in parenthetical

I not use JQuery.


use only "@rails/ujs": "^6.0.0" webpacker.


Rails -v 6.0.0.
Ruby -v 2.6.1


Help! Thanks!!!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9aaa2adf-c841-4a00-a43c-92c8e4dce8f7%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Rails 6. SyntaxError: missing ) in parenthetical (UJS)

Ariel Juodziukynas
Can you show the generated response of the request? try using the escape_javascript on the second render too ("j render....", the "j" at the beginning).

El lun., 26 ago. 2019 a las 9:38, Nikola Okonesh (<[hidden email]>) escribió:

I use pagination ajax (kaminari and pagy gem), click more page not work. how it


Снимок экрана_2019-08-25_23-54-07.png

  var colum = document.querySelector("#categories_index");
  var pagin = document.querySelector("#categories_index_paginate");

  colum.innerHTML += ("<%= j render(partial: 'article/posts/post', collection: @posts, cached: true) %>");
  pagin.innerHTML = ("<%= render(partial: 'next_link') %>");

SyntaxError: missing ) in parenthetical

I not use JQuery.


use only "@rails/ujs": "^6.0.0" webpacker.


Rails -v 6.0.0.
Ruby -v 2.6.1


Help! Thanks!!!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9aaa2adf-c841-4a00-a43c-92c8e4dce8f7%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDBTAdi-H1rr3Lf9hCe7C4fifz46J_ec3OYAarVJME7GQ%40mail.gmail.com.