Searching in Rails app with Ransack howto by Komal Swami - March 6, 2023March 6, 20230 Beginners guide In previous articles we have covered beginner guides for debugging ruby on rails application, in this post we shall cover searching and sorting in the rails app with ransack library. After reading this article you would realise that adding Ransack gem to your MVC- model and view controller application and you’re all set to use searching and sorting. You would barely need custom routes or helpers functions. Everything is available in ransack gem :-). At the end of this article I have tried to provide alternatives to ransack and some security flaws in ransack gem if it is used in default configurations. Introduction Ransack will help you easily add searching and sorting capabilities to your Rails application, without any
Beginners Guide To Managing User Permissions In Rails Apps development by Komal Swami - May 27, 20220 This post shares details about Beginners Guide To Managing User Permissions In Rails Apps and User Roles Management With Devise Gem in ruby on rails. There are lot of available resources on internet about device gem, as this is widely used gem when it come to user management and authentication solution for Rails. This has been used in solidus, sinatra etc. This post mainly focuses on beginer level to advanced level on how to setup devise gem and get going with step by step examples for Rails roles and permissions gem. Lets dwel into Devise gem. Introduction Ruby on Rails follows the DRY Don't Repeat Yourself principle of software development. which means we don't write the same piece of code over and
Beginners’ Guide To Pry Gem For Debugging RoR Applications development by Komal Swami - April 15, 2022April 15, 20220 In the previous post, we enjoyed playing around with Byebug, The de-facto debugger for Ruby on Rails Rails. This post for Beginners' Guide To Pry Gem For Debugging RoR Applications, will dwell on another debugging technique of debugging ruby on rails applications. Before getting into pry, As we know REPL, REPL stands for Read-Eval-Print-Loop. It’s a program that allows you to type Ruby code & see the result directly. IRB is the built-in Ruby REPL that every Ruby developer is familiar with. Debug Using IRB - Interactive ruby shell How can you use IRB?Interactive Ruby Shell. You can open IRB by typing IRB inside a terminal window. Then you can write your Ruby code & press enter to run it. If you
Debugging Ruby on Rails With byebug development by Komal Swami - March 28, 2022March 28, 20221 The de-facto debugger for Rails is Byebug. It works with Rails were things like Pry fall short, comes recommended by the core Rails team, and is even bundled with Rails. This article will walk you through getting set up with basic Debugging Ruby on Rails With byebug. The debugger permits the ability to understand what is going on inside a Ruby program while it executes and offers many of the traditional debugging features such as: Stepping: Running your program one line at a time.Breaking: Pausing the program at some event or specified instruction, to examine the current state.Evaluating: Basic REPL functionality, although pry does a better job at that.Tracking: Keeping track of the different values of your variables or the different lines executed by your program. Requirements Required:
Hello World With Sinatra Web Framework howto by Komal Swami - August 23, 2021August 23, 20211 Sinatra is a lightweight web framework. Sinatra is similar to Ruby on Rails web frameworks. It's pretty different from Rails as it's much lighter (less overhead), and you have more fine-grained control over your web app. Additionally, there is no built-in database functionality or page rendering — all of that is done manually. So it is more popular among millennials as you can bend it like the way you need. Sinatra Introduction Unlike Ruby on Rails, which is a Full Stack Web Development Framework that provides everything needed from front to back, Sinatra is fast, simple and efficient. However, with that comes more work and more room for error. Sinatra is best used for smaller web applications or ones that don't
How to add an external CSS stylesheet to your ROR application Uncategorized by Komal Swami - August 31, 2020August 13, 20210 I assume that you already have your css and html.erb files. Hello folks, when you make your first app using ruby on rails then you want it to look good especially when you know how the magic of css works and then end up using html tags for css stylesheet. but it dont work at all. when i was getting started with ruby on rails it was a big deal for me to find a way to add custom css to my UI so here are two simple steps and tadda your css start working. 1.You need to put all your css files in assets ->stylesheets and use <%= stylesheet_link_tag %> Thank you.