3

Using Rails 4.2.4, Faye 1.1.2, Thin 1.6.4, Render_sync 0.5.0. Did everything like in gem 'render_sync' docs (all necessary settings) and ran rackup sync.ru -E production, but got nothing: no auto partial update and no errors when I create new game. I can only update page by manual reload, but it's not what I really want)).

All in development environment.

Absolutely got no idea what is the problem. Please, help!

I've got in my code:

sync.yml

# Faye
development:
  server: "http://localhost:9292/faye"
  adapter_javascript_url: "http://localhost:9292/faye/faye.js"
  auth_token: DEVELOPMENT_SECRET_TOKEN
  adapter: "Faye"
  async: true

game.rb

class Game < ActiveRecord::Base
  sync :all
  sync_scope :sync_started_today, -> { Game.registered }
  ...

games_controller.rb

class GamesController < ApplicationController
  load_and_authorize_resource
  enable_sync
  ...
  def create
    if @game.save
      sync_new @game
      redirect_to games_path, notice: t('entry_added')
    else
      render :new, status: :unprocessable_entity
    end
  end

  def queue
  end
  ...

views/games/queue.html.slim

= sync partial: 'queue', collection: Game.sync_started_today

views/sync/games/_queue.html.slim

.div
  = game.try(:team)
...
Almazzzzz
  • 31
  • 1

0 Answers0