This is a repository with my demos to showcase how to implement several features, mostly using Ruby on Rails.
- Rename References - How to link a DB with more semantic namings.
- Enum - How to handle several status using
ActiveRecord::Enum
. - Validation: Pairs Matching - How to validate 2 pairs in a given model.
- Scope - How to implement a query scope in your model.
- Join Tables Demo - How to create models in a join table.
- Attach a photo - How to attach a file to a model in Rails.
- Seed photo from local image - How to attach a file to a model in Rails with a local picture.
- Attach PDF - How to implement some PDF attaching to your Rails app.
- Attach PDF and push to Cloudinary - How to implement some PDF attaching to your Rails app and push it to the cloud.
- ActiveStorage validations - How to add validations to an active storage model.
- Simple Ajax - How to implement Ajax for creating and deleting using Rails 6 with turbolinks.
- AJAX with Turbolinks - How to add the turbolinks gem to implement AJAX in Rails.
- AJAX with Rails.ajax - How to implement AJAX in Rails with a Javascript
fetch
usingRails.ajax
. - AJAX with JS.ERB (DELETE) - How to implement AJAX in Rails without Turbolinks on a DELETE request.
- AJAX with JS.ERB and Rails.ajax (UPDATE) - How to implement AJAX on an UPDATE request with small changes from the previous ones.
- AJAX with JSON and Rails.ajax (UPDATE) - How to implement the same AJAX on an UPDATE request using a
JSON
response from the controller. - AJAX with STIMULUS (DELETE) - How to implement AJAX in Rails without Turbolinks on a DELETE request.
- AJAX with STIMULUS (UPDATE and DESTROY) - How to implement AJAX in Rails with Stimulus on a UPDATE and DESTROY request.
- Order Card With Ajax and Stimulus - How to implement an order card with features to increase/decrease and add or remove an item to an order with AJAX and Stimulus.
- Basics - How to implement background jobs in the Model.
- In the controller with Devise - How to implement background jobs in the Controller.
- Create a Chat - How to create a chat in Rails.
- Handle CSS on a Chat - How to handle the css in a chat.
- Chat with stimulus - How to handle a chat with Stimulus.
- Notifications - How to handle notifications with Stimulus and Channels.
- Time in Rails - How to work with time (lato sensu) in
Rails
. - Nice date - How to implement an easy date picker in rails using the simple form gem.
- Better date picker - How to implement an easy date picker in rails using the flatpickr plugin.
- Better date picker with STIMULUS - How to implement an easy date picker in rails using the flatpickr plugin and stimulus.js.
- Booking Validation Logic - How to implement booking logic according to the available dates.
- Booking Logic Improved - How to improve the previous demo with SQL.
- Display Unavailabilities - How to implement the display of the unavailable dates with flatpickr.
- Devise basics - How to implement the basics of Devise in a Rails app.
- Login with Nickname - How to implement Devise in a Rails app to log in with something but the email.
- Omni-authenticator (Facebook and Spotify Login) - How to implement Omni Authentication login (with Facebook, Spotify etc) in Rails using the devise gem.
- User Edit on Modal - How to implement a modal in another page to edit a User in Rails using the devise gem.
- User new and another associated model - How to create a new user and a associated nested model in the same form.
- User new and another new model - How to create a new user and a associated new model in the same form. E.g. A user and their address.
- Graphql Rails Basics - How to have a glimpse on how to implement a graphql api using ruby on rails.
- Geocoder basics - How to implement the
geocoder
gem in a model, adding the coordinates according to the address. - Geocoder with two attributes - How to implement the
geocoder
gem in a model, adding the coordinates according to two attributes. - Geocoder Map - How to implement a map with
MapBox
and thegeocoder
gem. - Geocoder without address no create - How to geocode but with street, city and country as individual columns.
- Geocoder without address create - How to geocode but with street, city and country as individual columns. This time, we will make the address be saved in the record after geocoding.
- Display Map with Cards and Markers - How to display a map with cards and markers (like airbnb).
- Map with Clickable Markers - How to implement a map with clickable markers.
- Mapbox Clusters - How to implement a map with clusters and clickable dots.
- Pundit with Devise - How to implement Authorization with Pundit.
- Policy on another model etc - How to implement Pundit using another model as the parameter to check the Policy.
- How to generate a QR code - How to generate a QR code.
- How to add a QR code reader to your app - How to generate a QR code reader.
- Search-bar - How to create a simple searchbar.
- Basic-filtering - How to create a simple filter mechanism.
- PG Search - How to do not so simple searching.
- Filter by Tags - How to filter by tags.
- Associated Values - How to implement a form with associated (nested) models.
- Several models (same type) - How to implement the creation of several models (of the same type) in a single form.
- Several models (same type) dynamically - How to implement the creation of several models (of the same type) in a single form dynamically.
- Children as Checkboxes - How to create a form for a model with checkboxes for another associated model.
- Model and Nested Model - How to create a model and a nested model (or many nested models) in the same form.
- Keep Context Form - How to make a form take you back to the same position on the page without scrolling after submit.
- Input Switch Demo - How to implement a cool and simple switch on a boolean (checkbox) input.
- File Input Demo - How to implement a cool and simple switch on a file input.
- Display Uploaded Picture Demo - How to implement a display of the file input.
- Input toggle all inputs - How to create an input to toggle all other inputs.
- Day Month Year Demo - How to display a date input in simple form in the day-month-year format.
- Select2 with Stimulus - How to implement Select2 in a Stimulus controller in a input in simple form.
- Simple Multi-Step Form with Javascript - How to implement a simple multi-step form (a wizard) with simple form, bootstrap and stimulus.
- Multi-Step Form no Javascript - How to implement multi-step form (a wizard) with simple form and no javascript.
- Create a model with tags - How to create a model with tags.
- Create several tags at once - How to create several tags at once.
- Simple Testing - How to implement basic testing for features and models.
- Rails Helper - How to implement a simple Rails helper.
- Order by two cols - How to order a given Model using two columns as parameters.
- Shopping Cart - How to create and use a shopping cart.
- Service Objects - How to implement a service object.
- Order Card - How to implement an order card with features to increase/decrease and add or remove an item to an order.
- Select2-change-demo - How to trigger a change on select2 with JS.
- Card Flip Demo - How to implement a flippable card.
- Word Cloud Demo - How to implement a cloud of words with JS.