Activity
Yup. It's actually going to be faster than querying your database because Redis is all in-memory.
Posted in Google Maps and Google Places Autocomplete API with Rails, Turbolinks, and Stimulus.js Discussion
It sounds like they more or less don't want you downloading all their data and creating your own copy. That's their way of enforcing it. There are several good alternatives that might have better licensing.
Great idea!
Sure could. Just install the views, swap the header code with your dropdown, have it navigate after you select with Javascript and that should be good to go.
Only one referrer will get credit, typically that's the last referrer. That's how basically all referral programs work.
Posted in Rails for Mac OS Catalina
It probably wouldn't hurt upgrading to the latest version of mysql2: https://rubygems.org/gems/mysql2
If your app has a .ruby-version
file, then it will use the Ruby version in that file for the project.
Actually, think I spotted your error. You're not using ERB for rendering the link.
<a class="nav-link" href="pages_about_path">About</a>
That should be:
<%= link_to "About", pages_about_path, class: "nav-link" %>
pages_about_path
is a helper in Rails to generate the string /pages/about
for your route. You need to use ERB to make sure it runs that code and outputs href="/pages/about"
instead of outputting the raw string of href="pages_about_path"
.
Hey Alfred,
Can you post your actual error?
Not by default, it's too easy for people to lock themselves out if they aren't familiar with using SSH. We definitely encourage you to install it if you want. 👍
Yeah, there's not a real easy way when the schedules are dynamically generated.
Posted in foreman issues
If you read the Foreman README, they recommend you don't put it in your Gemfile. Just gem install foreman
globally.
That would come from a has_may :authors
association. ActiveRecord knows how to handle those associations through those methods.
It's documented here as collection_singular_ids
https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
You can't save street
to the Patient model if you don't have have a column with that name.
You said you were using a separate table to store the addresses, so you would need to use a nested form to fill out Patient and Address details at the same time.
Hey Thomaz,
You can simply access the data through the Patient association to Address.
<%= patient.address.street %>
Posted in Import into administrate?
Imports are usually pretty unique to your app, so I imagine they intend it to be that way since your format may not exactly match the database table.
There's several episodes here on GoRails talking about importing from CSV. I'd recommend checking those out and building that out for importing with Administrate.
Nothing too fancy. users/edit
comes from Devise. password/edit
is a passwords controller I added.
Depends on how up-to-date you want it to be. If you're fine with every day, then write a cron job to sync and update every day or something.
If you need it to be more real-time, then trigger an API request after you load the record to sync it with the latest value. They may also provide webhooks to send you the changes as needed which you would save you from making API requests which would be nice.
Posted in rails migration warnings
Totally fine and part of running Ruby 2.7.0 with Rails right now. They're just warnings like it says and it will be updated in Rails core shortly.
Hey Taylor, I agree that you should definitely use columns. I'm actually working on this functionality for Jumpstart Pro as we speak. 😜
Hey Ali,
This is a great question. What I would probably do for this is I would create a model that would cache the results of the API call.
Then I would use a before_action in ApplicationController to load that model for the current user. If it didn't exist, you can have it hit the API and save the results in the model.
The first request, the model shouldn't exist, but every time afterwards it will so you won't have to hit the API every time.
I wouldn't use the after_authentication hook exclusively just because there may be situations that come up where that method doesn't succeed and a user might not have any results. Imagine that external service went down for an hour or they returned a 500 error for some reason. If you do it every request instead, you can always hit their API as needed without worrying about missing records ever.