Skip to content

Dynamic params taken from DB in preview files are not showing until restarting the server #374

Answered by allmarkedup
RaulSeSo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @RaulSeSo,

So the problem here is that Lookbook only reloads the preview files when it detects a change to the file itself - it doesn't know anything about changes in your database.

It may be possible to trigger a manual update from within an active record callback, although I've never tried that myself. Something like this may work (for v1.3.3):

class Act < ApplicationRecord
  after_create do
    Lookbook.engine.parser.parse
  end
end

Let me know how you get on if you have a chance give it a try 🙂

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RaulSeSo
Comment options

@allmarkedup
Comment options

@RaulSeSo
Comment options

Answer selected by RaulSeSo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants