3 ms·
What are some specific “magical things” that are not mentioned in the rails guides? There’s always room for improvement and the documentation is an important p
by andrei_says_ 5y ago
What are some specific “magical things” that are not mentioned in the rails guides?
There’s always room for improvement and the documentation is an important part of the framework.
- MakerSam 5y agoI don't think the Rails Guides mention Devise, the authentication gem, which is pretty important if you want create a public facing website with users. The devise documentation is pretty good though. Again, a little bit of a learning curve, but once you learn it you can add user authentication to your site pretty quickly. https://github.com/heartcombo/devise#getting-started https://github.com/heartcombo/devise#getting-started
- craigmcnamara 5y agoIt's not in the guide because it's not core Rails. But there is a great site called RubyToolbox to help you find things that aren't core Rails. https://www.ruby-toolbox.com/categories/rails_authentication https://www.ruby-toolbox.com/categories/rails_authentication
- jemmyw 5y agoYou don't need devise, so I think it's good it's not included. It used to be that devise was good to use as it had the best practice way to set up the password fields etc. But that has been moved to rails core. It's still worth reading the devise documentation, but I'm so familiar with how it sets things up I can just set it up manually faster than messing around with devise itself.
- nomilk 5y agoAFAIK there's nothing in the rails guides to help with authorisation. I googled and couldn't decide between pundit and cancancan. I went with the latter because of some tutorial videos I found. But it wasn't easy: 1. I couldn't find documentation for methods so common as `can?` [1], and 2. the 'magic' of how rails automatically sets instance variables differently and sometimes not at all before each action was also very confusing. Like many other things, it was confusing until you understood what it was doing, but figuring out exactly what it was doing and why took hours of experimenting with the behaviours of each action, and being the recipient of quite a lot of condescension on stack overflow for even asking. [1] https://stackoverflow.com/q/63674415 https://stackoverflow.com/q/63674415