Activity
Posted in Hatchox deploy
Oh gotcha. Well I'd recommend using the Support tab in Hatchbox instead to file tickets so we don't accidentally share things publicly on the forum.
I'll take a look at your account.
I'll take a look at your account.
Posted in Hatchox deploy
I don't believe that your IP address can start with a 0. You should make sure you have the correct IP.
Posted in Using Webhooks with Stripe Discussion
All you do is grab the signing secret from your Stripe account and set that variable like you would do with the other keys. Link to how to use it is here: https://github.com/integrallis/stripe_event#authenticating-webhooks-with-signatures
I'll do a quick episode on this shortly!
I'll do a quick episode on this shortly!
Welcome! 👋
I don't know of any tutorials that do exactly something like this, but it sounds kind of like survey software maybe?
A few of the details will depend on how you want the app to work. Do you want ot have free form text answers for the questions or multiple choice or something different?
Will the questions be the same for everyone? Will they be configurable (like you can add / remove questions dynamically or will they always be the same)?
For the user dashboard, are you looking to show the same questions and the user's selected answers? Or something else?
Let us know and we can guide you through what you'd need to do!
I don't know of any tutorials that do exactly something like this, but it sounds kind of like survey software maybe?
A few of the details will depend on how you want the app to work. Do you want ot have free form text answers for the questions or multiple choice or something different?
Will the questions be the same for everyone? Will they be configurable (like you can add / remove questions dynamically or will they always be the same)?
For the user dashboard, are you looking to show the same questions and the user's selected answers? Or something else?
Let us know and we can guide you through what you'd need to do!
🙌 You're welcome!
As for the forms, you can just set the site in a hidden field. @page = Page.new(site: "google") for example.
Remember that your controllers don't have to directly map to models so you could have a controller for Google, separate from your Facebook one, and so on. Then you can have views that are unique so that you can have different designs, instructions, etc for each one.
As for the forms, you can just set the site in a hidden field. @page = Page.new(site: "google") for example.
Remember that your controllers don't have to directly map to models so you could have a controller for Google, separate from your Facebook one, and so on. Then you can have views that are unique so that you can have different designs, instructions, etc for each one.
Hey Rich,
I wouldn't worry too much about having a "messy" models folder. If you had 50 models, it might be a concern, but you don't currently have many and it's easy to move things around later.
What is the purpose of ReviewSite? It seems like an unnecessary model.
User
has_one :business
Business
belongs_to :user
has_many :locations
has_many :facebook_pages, through: :locations
has_many :google_pages, through: :locations
has_many :yelp_pages, through: :locations
Location
has_one :facebook_page
has_one :google_page
has_one :yelp_page
has_many :reviews
FacebookPage
belongs_to :location
GooglePage
belongs_to :location
YelpPage
belongs_to :location
Review
belongs_to :location
belongs_to :customer (or something)
ReviewRequest
belongs_to :customer
belongs_to :business (if you want to attach it to a business, could also be location)
As you can see here, the concept of a "page" seems repeated so you may still want to consider how truly separate they are.
Business
has_many :pages
Page
belongs_to :business
- site ("google", "facebook", "yelp")
- url
- number_of_reviews
- average_rating
- extra_data (json column, can be fully unique to each site)
Then you could just write other Ruby classes for handling the unique API situations. For example, to get the correct API client, you'd do something like:
def client
case site
when "google"
GoogleApi.new(token)
when "facebook"
FacebookApi.new(token)
end
end
This would be a more generic way of approaching things. You can have a json column to store any data that's unique to each business instead of making separate models for each.
Personally I would probably take this approach with generic pages. I haven't seen anything that seems to prevent taking this approach. This is how I handle the different APIs for Hatchbox.io btw. Servers on Hatchbox are like Pages and Reviews in your app. Sure they may be on a different service, but I can still store the generic information I care about in a single table and just keep track of which service it is. Then I write Ruby classes to handle the specifics and store the data on the model. Unless the data is vastly different, you will probably be best off with the generic Page like I'm doing with Servers. You can have a json column to store your extra information that may be unique to each site. If there is a lot of unique information for each Page, then definitely split up the models.
I wouldn't worry too much about having a "messy" models folder. If you had 50 models, it might be a concern, but you don't currently have many and it's easy to move things around later.
What is the purpose of ReviewSite? It seems like an unnecessary model.
User
has_one :business
Business
belongs_to :user
has_many :locations
has_many :facebook_pages, through: :locations
has_many :google_pages, through: :locations
has_many :yelp_pages, through: :locations
Location
has_one :facebook_page
has_one :google_page
has_one :yelp_page
has_many :reviews
FacebookPage
belongs_to :location
GooglePage
belongs_to :location
YelpPage
belongs_to :location
Review
belongs_to :location
belongs_to :customer (or something)
ReviewRequest
belongs_to :customer
belongs_to :business (if you want to attach it to a business, could also be location)
As you can see here, the concept of a "page" seems repeated so you may still want to consider how truly separate they are.
Business
has_many :pages
Page
belongs_to :business
- site ("google", "facebook", "yelp")
- url
- number_of_reviews
- average_rating
- extra_data (json column, can be fully unique to each site)
Then you could just write other Ruby classes for handling the unique API situations. For example, to get the correct API client, you'd do something like:
def client
case site
when "google"
GoogleApi.new(token)
when "facebook"
FacebookApi.new(token)
end
end
This would be a more generic way of approaching things. You can have a json column to store any data that's unique to each business instead of making separate models for each.
Personally I would probably take this approach with generic pages. I haven't seen anything that seems to prevent taking this approach. This is how I handle the different APIs for Hatchbox.io btw. Servers on Hatchbox are like Pages and Reviews in your app. Sure they may be on a different service, but I can still store the generic information I care about in a single table and just keep track of which service it is. Then I write Ruby classes to handle the specifics and store the data on the model. Unless the data is vastly different, you will probably be best off with the generic Page like I'm doing with Servers. You can have a json column to store your extra information that may be unique to each site. If there is a lot of unique information for each Page, then definitely split up the models.
Hey Rich,
The best advice for these types of questions will always depend upon what you want to do in the future with your app. Will you be treating Facebook, Google, etc reviews as mostly the same thing? Sure, you'll need to know the site and page the review was on, but will you have specific integrations with each site?
If they will stay mostly similar, then I'd keep it as a single model and just store the site like "google" "facebook" etc as a column and the url for the page. Then if you ever do need to add some more specific things you can just say "okay this is a google review, let's create a Google API client and sync any changes".
If you plan on having different functionality for each review type, then separate models make more sense. You can then add functionality that's unique to each site (maybe they have a lot of different attributes you want to store).
So it'll depend upon what you want to do going forward. You probably know that best since you're designing the product which means you'll probably have a better idea of which one will be most fitting with your product.
The best advice for these types of questions will always depend upon what you want to do in the future with your app. Will you be treating Facebook, Google, etc reviews as mostly the same thing? Sure, you'll need to know the site and page the review was on, but will you have specific integrations with each site?
If they will stay mostly similar, then I'd keep it as a single model and just store the site like "google" "facebook" etc as a column and the url for the page. Then if you ever do need to add some more specific things you can just say "okay this is a google review, let's create a Google API client and sync any changes".
If you plan on having different functionality for each review type, then separate models make more sense. You can then add functionality that's unique to each site (maybe they have a lot of different attributes you want to store).
So it'll depend upon what you want to do going forward. You probably know that best since you're designing the product which means you'll probably have a better idea of which one will be most fitting with your product.
Hey Ray! Have you seen this? https://github.com/plataformatec/devise/wiki/How-to:-Scope-login-to-subdomain
Posted in Backing up uploaded files (hundreds of gigs) to S3 using Backup gem without duplication on HD
Hey TL,
You're looking for the backup gem's Syncers concept: http://backup.github.io/backup/v4/syncers/
You can't use rsync with S3, but you can use this gem's S3 syncer to mirror all the files on disk with S3.
The S3 Syncer just takes some directories that you want to sync and will handle all the uploads. http://backup.github.io/backup/v4/syncer-s3/
You're looking for the backup gem's Syncers concept: http://backup.github.io/backup/v4/syncers/
You can't use rsync with S3, but you can use this gem's S3 syncer to mirror all the files on disk with S3.
The S3 Syncer just takes some directories that you want to sync and will handle all the uploads. http://backup.github.io/backup/v4/syncer-s3/
Posted in Any gem to create a 'What's new' page like the one I see in https://www.hatchbox.io/announcements
All the code for this the feature is in https://github.com/excid3/jumpstart
You'll want to grab:
1. Database column on User for last read announcements timestamp
2. Announcements model
3. Announcements routes, controller, and views
4. The navbar code to highlight the What's New link when there is are unread announcements for the user.
You'll want to grab:
1. Database column on User for last read announcements timestamp
2. Announcements model
3. Announcements routes, controller, and views
4. The navbar code to highlight the What's New link when there is are unread announcements for the user.
Posted in Where to get started?
It's either on the dashboard (click the logo in the navbar) as the 3rd step in the Welcome section, or on your account profile here: https://gorails.com/users/edit
Posted in Where to get started?
Don't forget to join us in Slack if you want to hang out and chat with us!
Posted in Where to get started?
Hey Justin!
I would probably recommend starting at the very first episodes. I covered a lot of the things you'll do in every app at the beginning and then started branching out to more features as time went on.
I would probably recommend starting at the very first episodes. I covered a lot of the things you'll do in every app at the beginning and then started branching out to more features as time went on.
Posted in how do i resolve this error?
Hey Alan!
Change your "book_params" method at the bottom of the controller to "recipe_params" and you should be good. Looks like just a copy-paste typo you missed. 🤓
Change your "book_params" method at the bottom of the controller to "recipe_params" and you should be good. Looks like just a copy-paste typo you missed. 🤓
Hey Jeff,
You want to either use the local_time gem to handle this client side or simply set the Time.zone to the user's timezone for every request.
For the second option, you have to save the timezone on their database record so you can retrieve it and set it every time.
local_time's a lot simpler as it just checks the browser's timezone and converts all the times using JS.
You want to either use the local_time gem to handle this client side or simply set the Time.zone to the user's timezone for every request.
For the second option, you have to save the timezone on their database record so you can retrieve it and set it every time.
local_time's a lot simpler as it just checks the browser's timezone and converts all the times using JS.
Thanks btihen! I'll get the tutorial updated for its changes shortly!
Posted in How to render ssh output
I'm moving this weekend, but I'll try and make an episode on this next week along with my continuation of the SOLID series!
Posted in How to render ssh output
Hey Quentin, I haven't covered it anywhere but I'd be happy to. Are you wanting to stream SSH output too or something similar?
Not sure, but you might check the git repo. I updated it to Rails 5.1 and Ruby 2.5 recently. Rails 5.2 shouldn't cause any differences but the webpacker gem does change frequently.
I didn't cover it. Early screencasting mistake. You can follow this episode to install Bootstrap. https://gorails.com/episodes/bootstrap-4-rubygem