Andrew Quinn

Joined

2,780 Experience
27 Lessons Completed
0 Questions Solved

Activity

I've just set this up one two separate apps. Everything is symlinked, so deploys don't effect it at all.

This guide is pretty good:
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

You'll have to change the webroot path to point to the rails app rather than a the basic html folder. The one other gotcha to look out for is if you're using CloudFlare. You need to specify the authenticator method to use webroot, or it won't authenticate. I believe this one does, but older articles haven't. You can read more on it here:
https://support.cloudflare.com/hc/en-us/articles/214820528-How-to-Validate-a-Let-s-Encrypt-Certificate-on-a-Site-Already-Active-on-CloudFlare

The tutorial should result in an A+ rating from the Qualys SSL Labs Report.

I think a guide on setting this up for rails specifically would be great. Maybe add it into the security series you keep talking about? Once you wrap your head around it you can get it setup and auto renewing in about 15 minutes.

Posted in Searchkick search_data not working

Yes thank you, I got it sorted. Was just on vacation the last 2 weeks. Thanks for checkin in.

Has anyone else had a problem with search_data like this: https://gorails.com/forum/s... ?

Posted in Searchkick search_data not working

I'm playing around with elasticsearch and searchkick, but I can't seem to get search_data working. Searchkick seems to ignore it all together.

If I only put one attribute in, it still searches on all the attributes. If I try and add a an attribute from a relation, it won't search on it. I've tried numerous syntaxes and now I'm at a total loss.

Here's my model:

class Contact < ActiveRecord::Base
    belongs_to :organization

    searchkick

    def search_data
        {
            fname: fname,
            lname: lname,
            cell_phone: cell_phone,
            work_phone: work_phone,
            organization_name: organization.name
        }
    end

end

I reindex after every change, but it doesn't seem to pick up changes to search_data. I've also tied numerous syntaxes for the relationship attribute including organization_name: organization(&:name).

Any help would be awesome.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.