Skip to main content

Posts

Showing posts with the label ror development

Ruby on Rails application using Devise

Devise is a flexible authentication solution for Rails. It is a complete MVC solution based on Rails engines. It allows you to have multiple models signed in at the same time. It hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication. STEP 1. gem ‘devise’ install. STEP 2. run bundle install STEP 3. run rails generate devise:install STEP 4. run rails generate devise:views STEP 5. Here in this application we mainly need 2 models, one is member model and the other one is contact model. So now we are going to create our  member model using devise:run rails generate devise member The migration file will located in db/migrate/ devise_create_members.rb. STEP 6. After that you should have to run rake db:create (For creating new database) STEP 7. run rake db:migrate Once you run the db:migrate command, rails will create ...

Enabling Cross Origin Resource (CORS) Sharing In Rails

How can my application share it's resources with another client? This is where the CORS, or Cross Origin Resource protocol comes in. CORS introduces a standard mechanism that can be used by all browsers for implementing cross-domain requests. The spec defines a set of headers that allow the browser and server to communicate about which requests are (and are not) allowed. CORS continues the spirit of the open web by bringing API access to all. What is a cross-site request? Cross-site HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. Such requests are subject to security-based restrictions. To handle this restrictions, and get around them in a secure manner, W3C developed CORS. What is CORS? The Cross-Origin Resource Sharing (CORS) mechanism provides a way for a server to support cross-site requests and enable the secure transfer of data across different domains/sites. How can our Rails AP...

Introduction of Docker Tools For Beginners

What is Docker? Docker is the world's leading software container platform. Docker is a tool designed to make it easier to deploy and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. Where does Docker operate? Design Development Deployment Testing/Release Docker makes the process of application deployment very easy and efficient and resolves a lot of issues related to deploying applications. Build app lication only once: An application inside a container can run on any system that has Docker installed. So there is no need to build and configure application multiple times on different platform. More Sleep and Less Worry With Docker you test your application inside a container and ship it inside a container. This means the environment in which you test is identical to the one on which the app...

How to Cleanup the Routes in Rails App Using ‘Traceroute’ gem?

Code cleanup refers to the act of writing code so that it cleans up leftover data structures and other unwanted materials from memory and the file system. It is not the same as refactoring code, which involves making the source code itself easier to understand, maintain, and modify. TraceRoute is the tool helpful for code cleanup. Integrate this gem in the Rails application by putting this gem into gem file. Traceroute is a route cleaning tool for Rails applications. It provides a simple rake task for checking which routes are mapped to non existing controller actions, and finds out which controller actions are not reachable. Cleanup the Routes in Rails App Using ‘Traceroute’ gem The following steps with the description implements Traceroute for code cleanup using traceroute gem in our ruby on rails application easily. STEP 1. gem install traceroute STEP 2. Bundle Install STEP 3. Type rake traceroute in command prompt and press Enter. List will appears w...