Devise hashes passwords and stores them using bcrypt by default. Looks like that may be replaced with clearance_sha1.
That's stored in the encrypted_password column in the database table. If you implement the same hashing algorithm, you can validate them against that column.
Check out this episode on Rails credentials. This is what I strongly recommend as all your credentials are easily organized and encrypted. Then in production you only have to set RAILS_MASTER_KEY to decrypt the file. Much easier to manage this way.
I haven't done direct uploads with Shrine v3 yet, but that's on my todolist.
Exactly. And if you need to rename it or make it more complex, delegate can still let you call
reservation.name even though it might delegate through a few objects if you had to add like approvals or some other model in the mix that made things more complex.
Yep, that could be a good use case. I use it frequently for things like that. It's not really any different than saying
reservation.customer&.name though with the new Ruby safe operator. It's basically doing that for you in the delegate method, but delegate will let you say
reservation.name instead of having to know the customer lives in between.
Posted in Did I forget to do a migration?
path helpers like
profile_path are not methods on the User model. You can use
<%= link_to "Profile", profile_path %> in your view to link to a route that matches that name.
The Rails guides would be a good place to read through how they work: https://guides.rubyonrails.org/routing.html#naming-routes
This doesn't (and shouldn't) have anything to do with your database. The error makes it look like that because you were trying to call a method on a database object.
Depends on how you're doing authentication. If you're using session cookies, it'll work out of the box. Otherwise you'll need to build your own mechanism that works similarly.
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.
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
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
Posted in How to relate such as tables of a scaffold and a model and presentation of data in the show.html.erb view of the scaffold. Rails.
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.