Skip to main content

Posts

Showing posts from July, 2018

Virtual Studio Code for Ruby on Rails Development

Introduction to Vscode (Visual Studio Code) Visual Studio Code i.e. Vscode is a modern and robust code editor developed by Microsoft. We can use it for setting up Ruby on Rails development environment. It combines the simplicity of code editor with powerful tools like IntelliSense, code completion, debugging and built-in Git support. One of the beauties of Vscode it's free and open source. It is available for Windows, Mac, and Linux with huge community support.  How to Install Vscode? Installation steps of Vscode are pretty simple, go to  Visual Studio  it will automatically detect the operating system you are using and provides a download link. After installation, you are ready to start customizing Vscode for Rails development. How do you set up Vscode for Rails? ·  Ruby extension: The first thing you have to install the ruby extension in Vscode. Press  f1 , type  ext install  then search for ruby OR go to ‘View’ > ‘Extensions’ and search for ruby and

All New Features Introduced in HTML 5 and CSS 3

As a web developer, everyone knows the importance of HTML & CSS for making his or her web pages to be interesting. We all know that web languages upgrade regularly, so all web developers need to stay current and updated. The latest version of HTML has introduced in the market i.e. HTML5. HTML5 has all new features that you will love to use while making document structure. A bunch of new tags to make our pages more semantic has introduced in this version. It will also help search engines and targeted audience to navigate our pages and improve the web experience for everyone. Some of the new semantics or structural elements have been covered here: Tags Description <article>   Defines an article in a document <aside>   Defines content aside from the page content <figure>   Defines self-contained content <mark>   Defines marked/highlighted text <progress>   Represents the progress of a task <section>   Defines a section in a document
Being a Rails developer we are familiar with ActiveRecord queries, but not so much with Arel. Arel is a library which allows us to customize our queries in an object-oriented manner without having to use manual SQL and string interpolation. We often use where a method for querying the database. Where method can handle equality, null, arrays and now in Rails 4 it is also able to handle inequality condition with not method. But when there is a requirement of writing queries with OR statement or greater-than or less-than conditions most developers opt for writing SQL string queries. We have a better way to handle this situation using Arel. For example: If you want to select students having the date of birth greater than today’s date or date of birth less-than or equals to today’s date, usually a developer will write the query like this Student.where("date_of_birth> ?", Date.today) or Student.where("date_of_birth<= ?", Date.today) But this is not a go