I
I
IvanN7772014-10-14 11:15:23
Ruby on Rails
IvanN777, 2014-10-14 11:15:23

How to connect the periodically_call_remote helper in rails?

I need to update the current time on a page.
I decided to use this helper (periodically_call_remote)
However, Rails unexpectedly gave an error

undefined method `periodically_call_remote'

Somewhere I read that it is necessary to connect
<%= javascript_include_tag 'prototype'%>
But it did not give success.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vsuhachev, 2014-10-14
@vsuhachev

Starting from version 3, there is an asset pipeline in rails, in short - there is a certain application.js manifest file in which you specify all js scripts. When installed, the assets are compiled into one js file. To connect third-party js, you need to put them in the vandor/assets/javascripts folder and include them in the manifest.
For common js libraries, there are gems that make it easy to connect these js libraries. For example see https://github.com/rails/prototype-rails

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question