Software engineering and personal development

Tag: gem (Page 1 of 2)

How to write complex queries using Globalize gem in Rails applications

Img source: railscarma.com

Globalize is one of the most famous gems that is used for translating dynamic content in Rails application. It is really easy to use, and brings a lot of conveniences immediately after you add it in your application. I recently had to do a more complex query using the table added by Globalize generator, and I could not find that much information about ways of doing joins for this newly added table with the one that it corresponds and that translates its attributes. In this article, you can see a short example on how to do that.

Continue reading

Translate dynamic content using Globalize gem

Img source: railscasts.com

We are in an interconnected world, where people across the planet can use the projects that we develop, and having the opportunity to offer them with additional international languages make them a lot better. We can obviously use locale for doing the translations of static strings like labels, or placeholder descriptions that appear across our applications, so we should also have something that can give us a way to translate the dynamic content.  There is a really great Ruby gem that makes the translation of model attributes a lot easier. This gem is called Globalize and is very easy to use.

Continue reading

Remove duplicate items from the left menu on rails_admin with this configuration

Img source: Stackoverflow

I recently had an issue with Rails Admin, which was displaying duplicate models in the left hand side menu. It was something that I had not encountered before, and it turned out, it was a rare occasion, as I could not find that much coverage about it. I also saw that this unanswered question related to this problem was published more than a year and a half ago in StackOverflow. This is the reason why I decided to write this post. Continue reading

Integrate search forms in your projects with Ransack gem

 

Img source: techbrownbags.wordpress.com

It is highly likely that you will have to work on a project that has some type of search forms implemented. Fortunately, as with many other type of functionalities that you can easily get out of the box without writing too much code in Rails projects, there is also a gem that is specific for this purpose. Ransack is a Ruby gem that enables the creation of both simple and advanced search forms for Ruby on Rails projects.

Continue reading

Debug your Ruby code using ByeBug gem

 

Img caption: medium.com

It is no doubt that one of the activities that takes most of the time of software developers is debugging. We as programmers can make many mistakes, which may lead to many bugs that need to be fixed. One of the best ways to fix these bugs, understand the flow of an application, or implement new features is through debugging. ByeBug is a great Ruby gem that helps us fix bugs and debug projects by going through each line. It is similar to pry, with additional functionalities. 

Continue reading

Create easy-to-use interfaces for managing your data with RailsAdmin

 

Image src: rails.devcamp.com

It’s obvious that a lot of applications need an admin panel, where the administrator or other lower level users need privileges to do certain data manipulations. Not everyone of them should be a technical person. Thus, you may need to provide them a user-friendly interface which gives them this opportunity. Fortunately, you can insert an admin panel in your Rails application easily using RailsAdmin.

Continue reading

Add authorization restrictions in your applications using CanCan gem

Img source: railscarma.com

It is no doubt that there are certain pages that you do not need to have them viewed by all the visitors of your application. You can also have users of different roles that may not be allowed to access certain parts of your applications. There is a really good Ruby gem called cancan that excels at this. It makes the authorization of your app resources pretty straight-forward, so you do not have to duplicate permission checking code across controllers and views.

Continue reading

« Older posts

© 2024 Fatos Morina

Theme by Anders NorenUp ↑