Rails 7 pagination with Kaminari tutorial
Intro : bloated data Displaying bulk of data in a single page is not a good practice because it slows down our rails application and will decrease the performance of the database server. Displayi...
Intro : bloated data Displaying bulk of data in a single page is not a good practice because it slows down our rails application and will decrease the performance of the database server. Displayi...
This is an opinionated article about ERB and HAML with Rails. Let’s compare each other and pick a winner. Use case In the Ruby-on-Rails world, they are known as templating languages. In the MVC c...
Authorization means give or refuse access to the current User to some URLs (or more generally, any kind of resource.) It’s closely bound to Authentication, but it’s different. Think about an inte...
Use the filter or select method Like JavaScript, you can choose to .filter an Array Ruby version ary = ['abc', 'bzz', 'aaa'] ary.filter{|e| e.include?('a')} # ['abc', 'aaa'] JS version let ar...
Intro I once had a conversation with an American at breakfast. He was eating a fresh French baguette, and seemed to be worried… his question finally was : Why is that so good? Why Americans...
With Ruby, there are some cases where you want to check if a given key is already in the hash. If you’re new to hashes, I wrote a basic blog article about Ruby hashes. Is checking the key of a ha...
In the need for authenticator Rails comes with no default way to authenticate the user, like Laravel does in the PHP world. For a long time, the Devise gem was the good-enough-way-to-go for Rails...
Short answer, encoding a Ruby String 2024 edition is : URI::Parser.new.escape(my_url_string) There’s already a full stackoverflow question about this, but it seems that from Ruby 3, the only wo...
“form_with” is known as a form helper, which means it’s an abstraction to build well-known, standard HTML form. In the need of form_with First, we should mention why we need a helper anyway. Afte...
Today I’m releasing a brand new Ruby-on-Rails starter kit. Here at saaslit.com Yes, I know, starter kits are all the rage nowadays, and there are already established free and commercial products...