adminable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f528b224feece004bb0e267e9d3c7c59fc8cb82c
4
- data.tar.gz: 1cef3dc442b2ac04713f0695762429afdf0b4637
3
+ metadata.gz: ed7d5e6b53555c9173e58a2428193fc82e2169d2
4
+ data.tar.gz: 1526f33a3846f594823bed6daa75122ad21cb4be
5
5
  SHA512:
6
- metadata.gz: a463389478cd68106b2e48567d1efe341f6aff36f087b5c0067e5d84d42c825ca020bae79b6650c3158b4433f00767582c5c2357435fb717c77f2dd33e7b6276
7
- data.tar.gz: de6a89ee40356740af5537167d0411cca5c922323339ff38a2d6be3c55b3264e2f3ab70e35194f1a48e3694db248aa32585e59df74a459bcd74f212616926d1e
6
+ metadata.gz: f9341f2b025e57567837f4681270f62dc6a5bd45b58cd6f21f8ea652d8a1a823cca842e51747efa9cbfcb932f1e0d98ef1e857f388118e107d4db9dd0d45e04e
7
+ data.tar.gz: fc5d3ccd581223b2827ce54759b9079e4cbc88b80330fd00de115c19d8ce2b7416d1a820a5480c0fb16b518110109564305942550249f63b14e943b075e6829b
@@ -1 +1,2 @@
1
- = strip_tags(value).truncate(30).squish
1
+ - if value
2
+ = strip_tags(value).truncate(30).squish
@@ -3,5 +3,5 @@ Adminable::Engine.routes.draw do
3
3
  resources r.route, except: :show, path: r.name, controller: r.name
4
4
  end
5
5
 
6
- root to: redirect(Adminable::Configuration.resources.first.name)
6
+ root to: redirect(Adminable::Configuration.redirect_root_path)
7
7
  end
@@ -20,5 +20,13 @@ module Adminable
20
20
  Dir[Rails.root.join('app/controllers/adminable/**/*_controller.rb')]
21
21
  .reject { |f| f['app/controllers/adminable/application_controller.rb'] }
22
22
  end
23
+
24
+ def self.redirect_root_path
25
+ if resources.any?
26
+ resources.first.name
27
+ else
28
+ Rails.application.routes.url_helpers.root_path
29
+ end
30
+ end
23
31
  end
24
32
  end
@@ -1,3 +1,3 @@
1
1
  module Adminable
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
@@ -17,7 +17,7 @@ module Adminable
17
17
  "#{Rails.root}/config/routes.rb",
18
18
  after: /routes.draw.do\n/
19
19
  ) do
20
- %( mount Adminable::Engine, at: '/adminable'
20
+ %( mount Adminable::Engine, at: '/admin'
21
21
 
22
22
  )
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adminable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Novikov