Skip to main content

Posts

Ruby on Rails pagination using Kaminari Gem

Kaminari gem is used to create pagination in Ruby on Rails application.           Step 1: Open the terminal and Create the new application       >  rails new simplepage       Step 2: After you create the blog application, switch to its folder:             > cd simplepage             Step 3: Open and Add it to your Gemfile to following line           gem 'kaminari'           Step 4: Run the bundle install.It's used to install the gem dependencies that are  already mentioned in Gemfile               > bundle install             Step 5: create the form using scaffolding. Rails scaffolding is a quick way to generate some of the major pieces of an application.(Create, Edit, Delete, Update, Show) ...
Recent posts

How to configure Devise gem for your Ruby on Rails Application (User Authentication)

Devise gem is used to make a simple authentication solution in rails.You no need to create authentication form it will create automatically. Like Username, Password, Signin, Signup, Forgot Password and Remember me.Please follow below steps. 10 Steps for Setup Devise gem in rails application :   Step 1 : Create a new Ruby on Rails Application       > rails new devexam       .   Step 2: Open Gemfile and add the devise gem in Gemfile (devexam/Gemfile)        gem 'devise'         Step 3: Install newly added gem       > bundle install        Step 4: Create the Product form with CRUD using scaffold       > rails g scaffold Product name:string price:integer description:text     Step 5: Apply changes to database.Product table added to database with help of migration.       > rake db:migrate ...

Load value to dropdown from table in Ruby on Rails

Its very simple to load the table value to dropdown box in ruby on rails.        Syntax :                  select(:model, :attribute, rails query) Example :       Now you need to load the countries table table to drop down mean                         select(:Country, :cname, Country.all.collect {|c| [ c.name, c.id ] })     Country => Its model name     cname  => Field name     Country.all  => Its load the all values to dropdown.     Its like "SELECT *FROM COUNTRIES"

Simple Pagination in Ruby on Rails using will_paginate gem Tutorials

You should use the will_paginate gem for pagination. Steps : 1. Create new project    Develop > rails new addpagination 2. Open the gemfile inside the project folder (addpagination).Add below line in gemfile    gem 'will_paginate', '~> 3.0' 3. Enter below command in terminal and execute.    Develop > bundle install 4. Create the Database    Develop > rake db:create    5. Create the form using scaffolding    Develop > rails g scaffold post name:string city:string    6. Migrate the table    Develop > rake db:migrate    7. Now run the application    Develop > rails s   8. Check the application.Its working or not.    open browser and enter http://localhost:3000/    9. Configure the page redirection in routes.rb inside the config folder      root 'posts#index' 10. Now add t...

How to get a YouTube video thumbnail dynamically from the YouTube API using AngularJS

In this tutorial I have explain about the get YouTube thumbnail using AngularJS <html ng-app id="YoutubeApp">   <head>     <title>       How to get a YouTube video thumbnail dynamically from the YouTube API using  AngularJS Tutorials</title>     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>     <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>     <script>       function YoutubeController ($scope) {         $scope.todos = [];         $scope. addVideo = function() {           $scope.todos.push({text:$scope.todoText, done:false});           $scope.todoText = '';  ...

How to get facebook user details using AngularJS

In this tutorial I have explain about the fetch Facebook user details using AngularJS <html ng-app id="customersApp">   <head>     <title> How to get facebook user details using AngularJS Tutorials </title>     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>     <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>     <script>       var app = angular.module('customersApp',[]);       function facebookController($scope, $http) {           //DwayneJohnson - facebook UserId           $http.get('https://graph.facebook.com/?id=DwayneJohnson')             .success(function (data) {     ...

Add google map with marker using AngularJS

In this tutorial I have explain about Google map using AngularJS <html ng-app=" googlemapsApp ">   <head>           <script src="http://maps.googleapis.com/maps/api/js?key=&sensor=false&extension=.js"></script>    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>    <title>Create google map using Angularjs Tutorials</title>    <style>      .map-container {         margin: 40px 260px;         }      #map {        height:420px;        width:600px;      }      .infoWindowContent {         font-size:  14px !important; ...