Implementing Rollbar in ember applications

Rollbar does real-time error monitoring for developers, It catches all types of errors and also show the root cause for error. In this article I am going to explain implementing Rollbar in ember application with ember-rollbar-client and configuration. Before using ember-rollbar-client we used 'ember-rollbar-cli` but It was not catching errors for Android and IOS builds. To use ember-rollbar-client add it in package.json After installing this package you need to add rollbar configuration in config/environment.js 'emberRollbarClient': { accessToken: 'rollbar-write-client-token' }; You can get 'rollbar-write-client-token' from rollbar for that you need to create a project in Rollbar. Then you will get

Ember Model Test Cases

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 'ember-data/relationships'; export default Model.extend({ status: attr('string'), createdAt: attr('date'), recentlyUsedAt: attr('date'), code: attr('string'), activity: attr('string'), description: attr('string'), detailType: attr('string')

Using Gravatar profile image in Ruby on Rails application

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 = "http://secure.gravatar.com/avatar/#{gravatar_id}" image_tag(gravatar_url, alt: user.name) end end Gravatar URLs are based on an MD5 hash of the

Create off-canvas side menu in ember

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 burger.state.actions.close}}>Close</button> <ul> {{#menu.item}} {{link-to 'Home' 'index'}} {{/menu.item}} {{#menu.item}} {{link-to 'Books' 'books'}} {{/menu.item}} {{#menu.item}} {{link-to 'Create

Authorization with cancancan.

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 devise and setting it up, it provides current_user method that returns 'current user' from session. We will use