Ratiata stars not loading into production (heroics)

So I had a rat working in development, just adding

<%= javascript_include_tag 'ratyrate.js', "data-turbolinks-track" => false %>

to the body of my gaze. Prior to this, stars were only loaded when the URL was directly accessible or the page was refreshed.

Now I have the same problem (stars do not load when the page clicks on the link) when deploying my application to a hero!

I hope that this is enough information (happy to provide more) and that someone has come across this before / have any ideas! Thanks!

allowed - see answer

+1
source share
3 answers

, , rake assets:precompile. , , .

<%= javascript_include_tag 'ratyrate.js', "data-turbolinks-track" => false %> (, ) .

Rails.application.config.assets.precompile += %w( ratyrate.js ) config/initializers/assets.rb.

, rake assets:precompile, , !

, -:)

+5

:

jquery.raty.js

jquery.raty.js jquery.raty.js.erb asset_path, :

cancelOff : 'cancel-off.png'

cancelOff    : '<%= asset_path('cancel-off.png') %>'

raty_helper.rb

rating_for raty , , , , .

, :

star_path    = options[:star_path]    || ''
star_on      = options[:star_on]      || image_path('star-on.png')
star_off     = options[:star_off]     || image_path('star-off.png')
star_half    = options[:star_half]    || image_path('star-half.png')
cancel_on    = options[:cancel_on]    || image_path('cancel-on.png')
cancel_off   = options[:cancel_off]   || image_path('cancel-off.png')

/ , , :

star_on      = options[:star_on]      || image_path('/star-on.png')

, , , , , .

+1

, . , rating_for, .

0
source

Source: https://habr.com/ru/post/1627100/


All Articles