friendly ids!
This commit is contained in:
parent
dbaded000f
commit
bb9d4bc371
4 changed files with 9 additions and 1 deletions
3
Gemfile
3
Gemfile
|
@ -24,6 +24,9 @@ gem 'cancancan'
|
||||||
# Haml for templating!
|
# Haml for templating!
|
||||||
gem "haml-rails", "~> 0.9"
|
gem "haml-rails", "~> 0.9"
|
||||||
|
|
||||||
|
# Friendly ids!
|
||||||
|
gem 'friendly_id', '~> 5.1.0'
|
||||||
|
|
||||||
# Pure for css
|
# Pure for css
|
||||||
gem 'purecss-rails'
|
gem 'purecss-rails'
|
||||||
# Use datatables
|
# Use datatables
|
||||||
|
|
|
@ -103,6 +103,8 @@ GEM
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
font-awesome-sass (4.4.0)
|
font-awesome-sass (4.4.0)
|
||||||
sass (>= 3.2)
|
sass (>= 3.2)
|
||||||
|
friendly_id (5.1.0)
|
||||||
|
activerecord (>= 4.0.0)
|
||||||
globalid (0.3.6)
|
globalid (0.3.6)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
haml (4.0.7)
|
haml (4.0.7)
|
||||||
|
@ -295,6 +297,7 @@ DEPENDENCIES
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
faker
|
faker
|
||||||
font-awesome-sass
|
font-awesome-sass
|
||||||
|
friendly_id (~> 5.1.0)
|
||||||
haml-rails (~> 0.9)
|
haml-rails (~> 0.9)
|
||||||
high_voltage (~> 2.4.0)
|
high_voltage (~> 2.4.0)
|
||||||
jbuilder (~> 2.0)
|
jbuilder (~> 2.0)
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
|
include FriendlyId
|
||||||
|
friendly_id :name, use: :finders
|
||||||
devise :timeoutable, :omniauthable, :omniauth_providers => [:zeuswpi]
|
devise :timeoutable, :omniauthable, :omniauth_providers => [:zeuswpi]
|
||||||
has_many :incoming_transactions,
|
has_many :incoming_transactions,
|
||||||
class_name: 'Transaction', foreign_key: 'creditor_id'
|
class_name: 'Transaction', foreign_key: 'creditor_id'
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
{
|
{
|
||||||
targets: 1,
|
targets: 1,
|
||||||
render: function(data, type, full, meta) {
|
render: function(data, type, full, meta) {
|
||||||
return data/100;
|
return (data/100).toFixed(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue