Why college projects are important?

In my career I had taken more than 100’s of interviews in my company and the number is raising up. Most of candidate are freshers and some are experienced developers. Fresher candidate apply for entry level job whereas experience developers apply for mid-level and senior level position. Here I’m not talking about experience developers. There…

Read more...

Rails tutorial: Send email with rails

In rails we use ActionMailer to send email. For more detail about ActionMailer check this link: http://guides.rubyonrails.org/action_mailer_basics.html Now its time to create mailer. Use following line of command to create mailer. Here I created Blog Mailer which is used to send email to all blog subscriber when new blog published. rails g mailer ArticleMailer Which…

Read more...

Lesson learned from hospital cleaning Staff

On 8th Jan, I got chance to visit a government hospital in Kathmandu. In the leisure time I observed different people including patient, doctors, hospital staff, cleaning staff. The hospital is clean in comparing with other government hospital. While observing cleaning team, I found few things: No one are waiting for their senior orders. They…

Read more...

Rails 5: redirect_to :back is not working?

In earlier version of Rails (<5.0) we used redirect_to :back to go previous page. With this method we got ActionController::RedirectBackError error when HTTP_REFERRER is not present. This may happen when we refresh the page. To fix this problem we have new method called redirect_back method as following: redirect_back fallback_location: root_path It will redirect to the…

Read more...

Rails SMTP configuration in runtime

SMTP is mail delivery method in rails  which is used to send email through rails. Setting of SMTP is configured in different environment like development, production and test. For this we configure following setting in different file like config/environments/development.rb, config/environments/production.rb, config/environments/test.rb with respect to different environment.  config.action_mailer.smtp_settings = { address: “smtp.gmail.com”, port: 587, domain: “mail.google.com”,…

Read more...

Install and use mongoDB with Rails in Ubuntu

MongoDB is a scalable, high-performance, document-oriented schemaless database. In this post I describe how to install MongoDB in ubuntu 12.04 and how to use mongobd with rails. Followings are the steps to install MongoDB 1. Add GPG Key sudo apt-key adv –keyserver keyserver.ubuntu.com –recv 7F0CEB10 2. Edit your source.list sudo gedit /etc/apt/sources.list and add this…

Read more...

Rails tutorial: Simple blog subscription feature in Rails

Before start this you have to setup new rails application with MySQL database. My previous post help you. Check this link: Setting MySQL database to Rails Application First of all generate a model called Subscriber with following command: rails g model Subscriber email:string Which will generate Subscriber model (app/model) directory and a migration file in…

Read more...

Setting MySQL database to Rails Application

MySQL is an open-source relational database management system. In this post I’m going to explain to use MySQL database to rails project. Install MySQL database if you do not have installed MySQL databse to your system.When you create new rails project with following command, it will add SQLite gem to the Gemfile, which is for…

Read more...

Use both MongoDB and MySQL database in rails project

You need to setup your rails project with both of the database connections. Firstly for MongoDB, you need to decide which driver wrapper (if you use one) are you going to use. The two common ones are MongoID & MongoMapper. Both do pretty much the same thing and make it easy to interact with Mongo…

Read more...

Naming Convention in Rails

Naming Convention is always a good practice to use suggestive variable names, Class and Module name, Database table, Module and Controllers name that will assist in the documentation of a Ruby on Rails program. A good convention for variable names, Class and Module name, Database table, Module and Controllers name can often assist someone in…

Read more...