Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

Discussion on iterators in Ruby

Welcome to Findnerd. Today we are going to discuss iterators in Ruby. Iterators are similar to loops but in iterators we know the beginning and end of the process. Please have a look.   v=0 while v<=10 v+=1 puts v end  ...

Fetching Single objects in Rails Applications

Fetching Single objects in Rails Applications through Active records   While creating a web application in rails we often feel the need to fetch single objects from the database.  Active records provide us with a very good quer...

Discussion on loops in Ruby

Welcome to Findnerd. Today we are going to discuss loops in Ruby. If we talk about the loops then you have used this in other programming languages but in ruby we use loops in some different ways. Loop is nothing but a piece of code which execute...

Discussion on control structures in Ruby

Welcome to Findnerd. Today we are going to discuss control structures in Ruby. If we talk about the control structures then you have already use or study in other programming language like C, C++, Java etc. We do not want to repeat the same thing...

Uses of booleans, ranges and constants in Ruby

Welcome to Findnerd. Today we are going to discuss booleans, ranges and constants in Ruby. Boolean is nothing but true or false. We use boolean for comparison. There are different type of comparison  and logical operators. Please have a look...

Discussion on hashes and symbols in Ruby

Welcome to Findnerd. Today we are going to discuss hashes and symbols in Ruby. We have written other blogs as well on Ruby so you can check these blogs for clear understanding of Ruby. If you have worked in other programming language then you sho...

How to implement CKEditor in rails application?

There are TinyMCE editor & CKEditor mostly used in web application. Here we'll discuss about CKEditor integration in our rails application. Editor is basically used by the web users to post formated contents to the sever. This blog w...

Arrays in Ruby and its uses

Welcome to Findnerd. Today we are going to discuss arrays and its uses in Ruby. We use  arrays in Ruby in the same way as we use in other programming languages. We all knows array is nothing but an ordered and integer based indexed collectio...

How to use Google Recaptcha with Devise in rails application?

In web applications, Captcha is used to prevent spam/bot from getting into our applications, inbox or databases. It ensures that web application using by a real human. Here, we are going to implement Googles reCAPTCHA service in our rails applica...

Social sharing in rails application

In modern days, we are using social media for web marketing which increase the traffic & popularity of our web sites. In Order to share posts/articles on net in rails application we can use the 'social-share-button' gem. To integrate ...

Basic concepts of Ruby

Welcome to Findnerd. Today we are going to discuss basic concepts of Ruby. In Ruby almost every thing is object. Objects deal as fundamental building blocks for Ruby.  Every thing which you manipulate or return after manipulation, is an obje...

Sending Email through SMTP mailer in Rails

Sending Email through SMTP mailer in Rails As we know these days in almost every application we have the need to send mails to its users then be it for password confirmations, subscriptions etc. So these mails can be sent through your rails...

Discussion on Ruby : An object oriented language

Welcome to Findnerd. Today we are going to discuss Ruby. Ruby is a programming language which supports object oriented programming structure. Ruby is developed or created in japan by Yukihiro "Matz" mastumoto in 1995. It uses similar sy...

Exceptions in Ruby

Exception is a unexpected output during execution of code in programing language. Due to exception execution of program stops.In Ruby, Exceptions are basically used to handle different type of errors, which may raise during execution of program a...

Iterators and its usage in ruby

In Ruby, iterators are methods basically used by the collections. Collections are a set of objects. Hashes & Arrays are the example of collections. Iteration is a process by which we can get or set the elements in collections. We will discuss...

Differences between Require, Load, Include and Extend methods in ROR

Include: If your application has many classes that need the same code, then we can keep that reusable code in a module and include that module in class. When we Include a module into a class, it is like we are taking all the methods within the m...

Rails 4 Strong parameter

Rails 4 has many new features, and Strong parameter is one of them. Strong parameter allows us to choose attributes that can be whitelisted for mass assignment. In rails 3 we were doing this by listing accessible attributes in the model. But in r...

How to add Custom font-size text-box in TinyMCE editor in rails application?

In my previous blog, I wrote about how to add Google fonts in TinyMCE editor and now there is a requirement to add a custom text-box by which user can customize font-size in TinyMCE-editor. In order to do this task we will follow all the steps...

Full text search in rails with pg_search

We often need to integrate search functionality in our application, If our rails application is using PostgreSQL as a database, then we can use pg_search gem. This is the easiest way to add a search feature on any rails application having postgre...

How to add Google fonts in TinyMCE editor in rails application?

In my app there is requirement to add Google fonts select-box in existing TyniMCE editor and also  fonts family should be load from app/assets folder. To complete this task we will following  the below steps.     ...

Using Delayed Jobs in Rails

Using Delayed Jobs in Rails When creating a web application sometimes need arises that we have to schedule some jobs during the execution of a particular method. Due to these job the render of the page has to wait until the task gets over...

Axlsx gem Integration in Rails

AXLSX gem is one the most recommended gem for the creating excel file in rails application. To integrate AXLSX gem, we have following steps. first we need to insert gem in our gemfile   gem 'axlsx_rails' and run bundle in...

Range operators in Ruby

Range operators in ruby are used to extract a sequence. Sequences have an initial point and end point by which we can generate consecutive values in the sequence. The values of a range may be objects, numbers, characters or strings.   ...

Responses In Rails: Part 1

Hi Friends, As we all know rails works on MVC Architecture, where the controllers acts as the receiver of the requests and sends the response back to the requester. There are actually 3 ways a controller can send a response : a) render: It ...

Rake task to parse third party XML file in rails

Parsing a xml file means separating a data block into pieces by following an algorithms, so that we can be easily manipulate.   If there are a requirement in rails application to read XMl file from remote, we can use the Nokogiri to re...

Rails Browsernizer gem

Sometimes it happens that our application doesn't support a browser with an older version, in that case, we wish to restrict a user from running our application on an older version. In rails, we have a solution to for this problem. Browserni...

Compare two strings by comparing the sum of their letter-Values

Description: Compare two strings by comparing the sum of their letter-Values (char-Value). For comparing treat all letters as UpperCase. Empty and null-Strings should be treated as they are equal. If the string contains other characters t...

Implementing Token Based Authentication in Rails

In modern world, most of the web applications are api based. So using api's we also need to validate the authenticity of the user. When it is a proper web application the authentication of the user is maintained using cookies and sessions. Bu...

Inspect, to_s, p and puts in ruby

In rails, sometimes we don't notice it but there is difference when you use puts to print an object and when you use just p to print an object. One thing let me clear for you, p is not a short form of puts, they both are different.&...

Installing And Using NGROK (Rails)

Installing And Using NGROK for Rails Application NGROK allows our web application running on localhost web server to be exposed to the internet. Its like making our web application live. It creates a secure tunnel from a public ...

Friendly-URLs in rails

By default rails applications build URLs based on the primary key(id column) from the database. Suppose we have a User model and associated controller and we have a user record for John Martin that has id number 50. So the URL for his show page w...

Filters in Rails

Generally whenever a request comes to the controller, controller invokes the requested action and send the response back to the view, but sometimes we need some actions(authentication) to be executed  before or after the action is called, in...

split ,find_index , map and capitalize methods in Ruby

Strings in Ruby have an instance method namely split that splits the given String and returns an array of substrings based on the separator given as an argument to it. have a look at these examples: gauravjhadiyal@gauravjhadiyal:~$ irb 2...

RecordNotFoundException

class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :configure_permitted_parameters, if: :devise_controller? protected def configure_permitted_parameters devise_parameter_sani...

using return keyword within a Ruby block

As we all know,Ruby Blocks and Ruby Methods work in tandem and the output/value of the last line/expression being executed by the block is returned to the associated method . Have a look at this example: 2.1.5 :006 > def demo 2.1.5 :0...

faker gem integration in rails application

A faker gem is used to create the fake data for testing or demo purpose in rails application. It is Perl's Data::Faker library that generate different type (i.e. Address, color, code, commerce, company, date etc.) of fake data. We are general...

Implicit and Explicit Blocks in Ruby

Blocks are basically a group of code that can be stored in a parameter and can be executed. There are majorly two ways of doing this:   1) Implicit: In implicit, it is a nameless block and it is not passed as a parameter, it is exec...

Use of Super Keyword and Mixins In Ruby

Use of Super Keyword and Mixins In Ruby Super Keyword Ruby gives us with a built-in function called super that allows us to call methods which are present in its super class.  The use of inheritance is to make the overridden methods...

Overriding Equality of objects

Overriding Equality of objects In ruby the equality of the objects depend upon several things, which are a) == b) hash c) eql? In normal cases whenever you run == method for string numbers etc it works perfectly fine, but if there ar...

Method Overloading and Overriding In Ruby

Method Overloading Method overloading can be achieved by declaring two methods with the same name and different signatures. These different signatures can be either   1.Arguments with different data types, eg: method(int a, int b) vs m...

Sum without highest and lowest number in an array

Description: Sum all the numbers of the array except the highest and the lowest element. Example: { 6, 2, 1, 8, 10 } => 16 If array is empty or null, or if only 1 Element exists, return 0.   Test Cases: Test.describe("...

Ruby Blocks

As we all know,Ruby Blocks and Ruby Methods work in tandem as clearly elucidated by the below example: def demo_method yield "hello" end demo_method { |block_argument| "#{block_argument}!! our first ruby blog"}   here, the ...

pg_search gem integration in rails application

If we are using PostgreSQL RDBMS in rails application and there are need to search functionality, pg_search gem is perfect for that. It has easy implementation and having rich methods for the search functionality. Note: pg_search gem supp...

attr_accessor and attr_accessible methods in Rails

As we know a class can have any number of objects and each object is different from one another. The thing that distinguish one object from another is the attributes they have. So in order to write and read these attributes we have some methods i...

Few Important Hash Methods in Ruby

Hash: Hashes are way of storing data in key-value pair format. Key can be any ruby object ( i.e. string, numbers ). Here we will see some of mostly used methods for hashes. 1) Creating/Initializing a hash: Hash can be created i...

Integrate twilio with rails

Twilio is a cloud-based service that allows software developers to programmatically make and receive phone calls and send and receive text messages using Twilio's cloud APIs. So once developer integrates their application with Twilio, their a...

Join and Inject methods for arrays (Ruby)

Join and Inject methods for arrays in ruby Join method is used to combine all array elements into one string. With the help of join method we can combine a lot of strings present in an array into one single string. Join method can a...

HAML in Rails

Rails default templating language is ERB which embeds ruby code into a HTML document, but there is an alternative templating language available called HAML. HAML(HTML abstraction  markup language) provides an elegant syntax which is easy to...

How to create an app to upload resume or doc file in rails?

Lets suppose , we need an application which able to upload a file(i.e. pdf, doc, htm, html, docx) and user can delete it form the list in rails. So here we will use 'carrierwave' to upload file and for styling the pages use 'bootstrap...

Array operations in ruby

In our regular programming life, we always come in to situation where we need to pick few elements from array, remove them or insert some elements into them. In ruby there are methods available for such operations. Some of them are: 1) Select:...
prev 1 2 10
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: