Ruby On Rails

Active admin resolve kaminari and will paginate gem conflict issue

Add config/initializers/kaminari.rb Kaminari.configure do |config| config.page_method_name = :per_page_kaminari end Add config/initializers/will_paginate.rb if defined?(WillPaginate) ActiveSupport.on_load :active_record do module WillPaginate module ActiveRecord module RelationMethods def per(value = nil) per_page(value) end def total_count() count end end end module CollectionMethods alias_method :num_pages, :total_pages end end end end Pagination example on active admin controller do def index index! do |format|… Continue reading Active admin resolve kaminari and will paginate gem conflict issue

Ruby On Rails

Bootstrap – Images

<!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Example</title> <meta charset=”utf-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1″> <link rel=”stylesheet” href=””&gt; <script src=””></script&gt; <script src=””></script&gt; </head> <body> <div class=”container”> <h2>Rounded Corners</h2> <p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p> <img src=”cinqueterre.jpg” class=”img-rounded” alt=”Cinque Terre” width=”304″ height=”236″> </div> <div class=”container”> <h2>Circle</h2> <p>The .img-circle class shapes the… Continue reading Bootstrap – Images

Angular JS · Rails4 · Ruby On Rails

Angular JS implementation with Rails 4

Step 1 :¬†Create rails app using rails new employee_detailsStep 2 : Remove turbolinks gem from gemfile and add ‘pg’ gem for postgres. Set the rails version to 4.1.2 (Turbolinks may not work with angular js)Step 3 : Run bundle installStep 4 : Change database.yml to use postgresdevelopment: adapter: postgresql encoding: unicode database: employee_details username: postgres… Continue reading Angular JS implementation with Rails 4

Rails 3 · ruby · Ruby On Rails

Naming conventions on Ruby & Ruby on Rails

Ruby Naming Conventions Local VariablesLowercase letter followed by other characters, naming convention states that it is better to use underscores rather than camelBack for multiple word names, e.g. mileage, variable_xyz Instance VariablesInstance variables are defined using the single “at” sign (@) followed by a name. It is suggested that a lowercase letter should be used… Continue reading Naming conventions on Ruby & Ruby on Rails

Ruby On Rails


Originally posted on RamOnRails:
Requirement:¬† There are two web applications AppX,AppY. All user relevant informations are stored under AppX. When user signing in into AppX, that time user session would be available in AppX. Because devise authentication mechanism is applied only on AppX. Also the same user session has to be applied for AppY,while user…

Ruby On Rails

ArgumentError: invalid byte sequence in UTF-8

You might be receiving ‘ArgumentError: invalid byte sequence in UTF-8‘ error if the URL consists of invalid byte sequences like http://localhost:3000/users/signup?%28t%B3odei%29 To get rid of this error, just add the below to your Gemfile gem ‘utf8-cleaner’ and make bundle install. utf8-cleaner gem removes invalid bytes on the URL and save your app from the page… Continue reading ArgumentError: invalid byte sequence in UTF-8