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

488 views
Skip to first unread message

Nikola Okonesh

unread,
Aug 26, 2019, 8:38:00 AM8/26/19
to Ruby on Rails: Talk

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!!!

Ariel Juodziukynas

unread,
Aug 26, 2019, 8:50:35 AM8/26/19
to rubyonra...@googlegroups.com
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).

--
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 rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9aaa2adf-c841-4a00-a43c-92c8e4dce8f7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages