Tag: ruby on rails

single quoted string VS Double quoted string [RUBY]

Single Quoted Double Quoted Does not allow string interpolatio foo = 'Hello' puts foo => Hello foo = 'Hello' bar =  'check #{foo}' => ##Error Allows string interpolation foo = “World” puts foo =>Hello foo = 'Hello' bar =  “check #{foo}” puts bar => check Hello Single quotes preserve escaped characters puts 'i \n love … Continue reading single quoted string VS Double quoted string [RUBY]

Advertisements

Select VS Detect [RUBY]

Ruby Select Ruby Detect Returns an array containing all elements of enum for which the given block returns a true value. If no block is given, an enumerator is returned instead.  Returns the first element for which block is not false. If no object matches returns nil . If no block is given, an enumerator is returned instead. items.select(...) returns all elements that meet criteria … Continue reading Select VS Detect [RUBY]

Ruby On Rails Interview Questions

Here are few of the interview questions which have been recently asked by companies What is the difference between Ruby Select and Detect? What is the difference between Ruby strings declared with  single quotes and the one declared with double quotes? What is the difference between Classes and Modules? What are different types of associations … Continue reading Ruby On Rails Interview Questions

RUBY | RAILS | RBENV on linix

In This Tutorial we will be setting up Rails on Linux System in my case its Cent OS 7 if you are using Ubuntu useapt-getinstead ofyum First install all the dependencies including GIT yum install git-core curl zlib1g-dev build-essential libssl-dev libreadli ne-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-open ssl-dev python-software-properties libffi-dev Setting Up Ruby with Rbenv … Continue reading RUBY | RAILS | RBENV on linix

Setting up User Authentication in Rails (Devise, Facebook,Twitter,Google)

I this Tutorial we will create a new rails application in which we will setup social authentication. We are starting with implementation of user authentication in rails with Devise later followed by implementing social authentication options for users using omniauth. Basic Application Setup: rails new social_auth_demo ## Gemfile ## gems for authentication gem 'devise' gem … Continue reading Setting up User Authentication in Rails (Devise, Facebook,Twitter,Google)