One of the great things about developing Rails applications is that you don’t have to restart the server to test every change that you have made in your code. Still, there are cases when you may need to restart the server, but may face troubles trying to stop it, especially if you have your project server is started as a demon.
Continue readingTag: ruby (Page 1 of 3)
If you are sometimes feeling bored and want to entertain yourself, then rather than aimlessly scrolling in a social media, you can try to learn something new. For example, you can learn something that you have not known that you can do with Ruby: Getting the dates for next Mondays, Tuesdays or any other day of the week. Continue reading
Writing tests in your projects is really important, especially because you need to make sure that things that have been implemented are already working as expected, and that future changes do not break something that is already working. In your projects, you may need to test that certain values are being assigned as expected, and sometimes trying to fix failing tests, or when writing new ones can be difficult to decipher the issue. Fortunately, a new Ruby gem has been implemented which is developed making this thing a lot easier.
One of the most used Rails method for routes is resources. Another similar one also exists, but that may not be known that much. It is resource and there is actually a difference between them. Continue reading
If you ever needed to paste a code that you have written in your favorite IDE or editor inside Microsoft Word and do not want to lose your formatting, then PlanetB is a really great tool that gives you that opportunity. It has a really easy-to-use user interface. It comes with the support for several programming languages like: C/C++, C#, CSS, Delphi, Pascal, XML, Java, Javascript, PHP, Python, Ruby, SQL, VB and HTML. Continue reading
There can be cases when you need to test something with the actual data, in a production environment, but you do not want to risk anything. You do not want to even think about the possibility for a data loss of the project that you are working it. Luckily, there is a really beneficial feature that is not that much known from Rails developers is a quick tool that you can use to test out some code without changing any data in your real database.
User roles are definitions of what users can do while using your applications. For example, when you are developing a marketplace for renting cars, you may need at least two user roles: hosts, who provide their cars, and users, who rent cars. Both of these user types will have different functions that they have at their disposal. Rolify is a Ruby gem that allows you to easily add and manage user roles in your application.
It can be integrated with other Ruby gems that you may need like authentication gems (devise, Authlogic, Clearance) and authorization gems that don’t provide role classes (CanCanCan, authority, Pundit).
You can install it as any other Ruby gem, and fortunately, it comes with a great README walk-through of the setup procedure and usage that you can follow along.
As it is an open source project, you can view its source code, learn how it’s built and also become a contributor to it.
Click here to learn more about it.
It is really hard to think about a real world project in which you are not going to have strings. As a result, having pre-existing methods for manipulating strings is really productive, as it saves you time. In today’s article, I want to emphasize a particular method in Ruby on Rails, that’s surprisingly not that much well known, which helps you with the whitespaces. Continue reading
I recently stumbled upon a new GitHub repository that has a long list of tutorials building many technologies. The list varies from tutorials on how to Build your own Blockchain / Cryptocurrency to Build your own Web Server and Build your own Template Engine, many more. Continue reading
Passwords one of the most frequent ways that we use to access our digital accounts. Having secure passwords is really crucial, and represents one of the most important aspects that we need to pay attention to. As developers, we also need to make sure that we provide our services with a high level of security. Last year 2017 NIST (National Institute of Standards and Technology) recommended to check user passwords against existing public breaches of data, and fortunately, there exists an API that allows you to do that really easily. Continue reading