All blog articles by Vivek Sriram
F88262a1d820ae3e7234b6c370e07d2a
Vivek Sriram

In this article I am going to show how to write model attribute and computed property test cases for ember applications.

I have been writing test cases from couple of days in GoodCity ember app. I will takeDesignation model as an example model to write test cases. Designation model has shown below.

models/designation.js

import Ember from 'ember';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo, hasMany } from...

Read complete blog post

If you want to show users gravatar profile picture in your rails application this article may help you Its very simple to use gravatar image in rails application by these simple steps

We need to create a helper method that returns Gravatar image for given user in your app/helpers/users_helper.rb as shown below

module UserHelper
 def user_gravatar(user)
 gravatar_id = Digest::MD5::hexdigest(user.eamil.downcase)
 gravatar_url =...

Read complete blog post

In this article I am going to show you how to create and customise animated off-canvas side menu in ember with ember-burger-menu.

In your ember application just install ember-burger-menu by

ember install ember-burger-menu

It will also install ember-cli-sass , After installing this package we need to add the following code to get menu template in application.hbs

{{#burger-menu as |burger|}}
 {{#burger.menu itemTagName="li" as |menu|}}
 <button {{action...

Read complete blog post

F88262a1d820ae3e7234b6c370e07d2a
Vivek Sriram

Cancancan is a gem used for Authorization in rails applications. It's very easy to use and offers a lot of flexibility. In this article, I am going to explain how to use cancancan for Authorization when users have many roles.

Installation:

Add this to your gem file and run bundle install

 gem 'cancancan'

cancancan is continuation of the dead CanCan project.

Cancancan gem is independent of any authentication system. I used cancancan gem with devise gem. After creating User model with...

Read complete blog post