Stephane PAQUET PRO
Joined 5/29/2021
Stephane PAQUET PRO said over 1 year ago on Creating Embedded Iframes :
It looks like a few things have changed over the last few months and `headers["X-Frame-Options"] = "allowall"` does not seem to be working anymore with recent browsers.

I found this Stackoverflow article about the topic https://stackoverflow.com/questions/67561924/ruby-on-rails-allow-embedding-of-your-website-in-other-sites-using-frame-ancesto and it appears that the "new" way of doing it is by overloading a Content Security Policy.

I ended up with the following content_security_policy.rb file
Rails.application.configure do
  config.content_security_policy do |policy|
    policy.default_src :self
    policy.frame_ancestors 'self', "*"
  end
end

You can also decide to not override the property on a case by case (controller level).

I still have one issue: making it work with nested routes
  resources :events do
    resources :questions, shallow: true
  end
the render template code in the example does not seem to be working as the URL is events/:event_id/questions :-(
But I will get something working at some point.
Cheers

Stephane PAQUET PRO said 9 months ago on Reloadable Fixtures :
I still have issues in my project getting the id properly working. We are using UUIDs and not  integer increments in our Postgres database. Could that be the issue? I eventually have to create the id and pass it to the different models ... so not that convenient.

Any idea why?

Stephane PAQUET PRO said 9 months ago on LLM Context :
Have you tried https://github.com/andreibondarev/langchainrb or https://github.com/BoxcarsAI/boxcars for this type of application? Which one do you prefer?

Stephane PAQUET PRO said 4 months ago on Direct Upload Instantly :
  Bashar , you're welcome

Stephane PAQUET PRO said 2 months ago on Text to Speech :
Improving the code for the setPreferredVoices function:

const preferredVoice = this.preferredVoices
  .map(name => voices.find(v => v.name === name))
  .find(Boolean);

if (preferredVoice) {
  Object.assign(this.utterance, {
    voice: preferredVoice,
    lang: preferredVoice.lang
  });
  console.log(`Selected voice: ${preferredVoice.name}`, `Selected lang: ${preferredVoice.lang}`);
}

it looks like Claude, Meta and O1-mini are all in agreement with this code ;-)