breadcrumbs_rails 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +2 -0
- data/badges/license.svg +1 -0
- data/badges/rails.svg +1 -0
- data/badges/ruby.svg +1 -0
- data/breadcrumbs_rails.gemspec +24 -0
- data/lib/breadcrumbs_rails.rb +85 -0
- data/lib/breadcrumbs_rails/breadcrumb.rb +46 -0
- data/lib/breadcrumbs_rails/breadcrumbs.rb +37 -0
- data/lib/breadcrumbs_rails/railtie.rb +10 -0
- data/lib/breadcrumbs_rails/version.rb +3 -0
- data/lib/generators/breadcrumbs/config_generator.rb +11 -0
- data/lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_bootstrap.html.erb +13 -0
- data/lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_bootstrap.html.haml +8 -0
- data/lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_html.html.erb +13 -0
- data/lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_html.html.haml +8 -0
- data/lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_inspinia.html.erb +21 -0
- data/lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_inspinia.html.haml +13 -0
- data/lib/generators/breadcrumbs/templates/config/initializers/breadcrumbs_config.rb +1 -0
- data/lib/generators/breadcrumbs/views_generator.rb +22 -0
- data/readme.md +114 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d28a2673f20c576627472cdb98978eccd61e2cf2f2a850cc226bfc60a74110ac
|
4
|
+
data.tar.gz: b24469f0e3ff01edd282af0c4d39570d5b402010996aae8139fffd6acb63f011
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 559cf5bbdcb461a721f37d05ba0e4f601f4ee166e09266d19e42b78525738d25b9ba45d97dbafb11bcbf9e59fe7ef9a054640f4eac904610dbe3592675c88590
|
7
|
+
data.tar.gz: 0d6f7a5b9232c82e5dc037a214b9631a702b2b0e8690463af0eed5f09800f416582c02e7fafabb89c42cb4647957cac65346cb7d648ab1903a316b4007e6c108
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/badges/license.svg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="112" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="112" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#4c1" d="M47 0h65v20H47z"/><path fill="url(#b)" d="M0 0h112v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" textLength="370">license</text><text x="785" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="550">CC BY 4.0</text><text x="785" y="140" transform="scale(.1)" textLength="550">CC BY 4.0</text></g> </svg>
|
data/badges/rails.svg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="70" height="20" role="img" aria-label="rails: 3.0+"><title>rails: 3.0+</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="70" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="33" height="20" fill="#555"/><rect x="33" width="37" height="20" fill="#fe7d37"/><rect width="70" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">rails</text><text x="175" y="140" transform="scale(.1)" fill="#fff" textLength="230">rails</text><text aria-hidden="true" x="505" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">3.0+</text><text x="505" y="140" transform="scale(.1)" fill="#fff" textLength="270">3.0+</text></g></svg>
|
data/badges/ruby.svg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="84" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="84" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#007ec6" d="M37 0h47v20H37z"/><path fill="url(#b)" d="M0 0h84v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">Ruby</text><text x="195" y="140" transform="scale(.1)" textLength="270">Ruby</text><text x="595" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">1.9.3+</text><text x="595" y="140" transform="scale(.1)" textLength="370">1.9.3+</text></g> </svg>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'breadcrumbs_rails/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'breadcrumbs_rails'
|
7
|
+
spec.version = BreadcrumbsRails::VERSION
|
8
|
+
spec.authors = %w(EdCordata)
|
9
|
+
spec.summary = %q{Rails breadcrumbs gem}
|
10
|
+
spec.description = %q{Rails breadcrumbs gem}
|
11
|
+
spec.homepage = 'https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails'
|
12
|
+
spec.metadata = {
|
13
|
+
'documentation_uri' => 'https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails/blob/master/readme.md',
|
14
|
+
'source_code_uri' => 'https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails',
|
15
|
+
'bug_tracker_uri' => 'https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails/issues'
|
16
|
+
}
|
17
|
+
spec.license = 'CC BY 4.0'
|
18
|
+
spec.files = `git ls-files`.split($/)
|
19
|
+
spec.require_paths = %w(lib)
|
20
|
+
spec.required_ruby_version = '>= 1.9.3'
|
21
|
+
spec.add_development_dependency 'rake'
|
22
|
+
spec.add_development_dependency 'bundler'
|
23
|
+
spec.add_development_dependency 'rails', '>= 3.0'
|
24
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'breadcrumbs_rails/version'
|
2
|
+
require 'breadcrumbs_rails/railtie'
|
3
|
+
require 'breadcrumbs_rails/breadcrumb'
|
4
|
+
require 'breadcrumbs_rails/breadcrumbs'
|
5
|
+
|
6
|
+
module BreadcrumbsRails
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
|
10
|
+
# ----------------------------------------------------------
|
11
|
+
included do |base|
|
12
|
+
|
13
|
+
|
14
|
+
unless base.respond_to?(:before_action)
|
15
|
+
base.alias_method :before_filter, :before_action
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
helper_method :render_breadcrumbs_title, :render_breadcrumbs
|
20
|
+
|
21
|
+
|
22
|
+
def add_breadcrumb(name, options = {})
|
23
|
+
self.breadcrumbs_gem.breadcrumbs << ::BreadcrumbsRails::Breadcrumb.new(
|
24
|
+
name_string: name,
|
25
|
+
path_string: options[:path],
|
26
|
+
locale: options[:locale],
|
27
|
+
localize: options[:localize],
|
28
|
+
)
|
29
|
+
|
30
|
+
self.breadcrumbs_gem.localize = options[:localize] if options.has_key?(:localize)
|
31
|
+
self.breadcrumbs_gem.locale = options[:locale] if options.has_key?(:locale)
|
32
|
+
self.breadcrumbs_gem.scope = options[:scope] if options.has_key?(:scope)
|
33
|
+
self.breadcrumbs_gem.title_string = options[:title] if options.has_key?(:title)
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def breadcrumbs_gem
|
38
|
+
@breadcrumbs_gem ||= ::BreadcrumbsRails::Breadcrumbs.new
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def render_breadcrumbs_title(default = nil)
|
43
|
+
breadcrumbs_gem.title || default
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def render_breadcrumbs(template: nil, &block)
|
48
|
+
if block_given?
|
49
|
+
yield(breadcrumbs_gem)
|
50
|
+
else
|
51
|
+
|
52
|
+
if template.nil?
|
53
|
+
partial = 'breadcrumbs/breadcrumbs'
|
54
|
+
partial = (breadcrumbs_gem.scope + '/' + partial) unless breadcrumbs_gem.scope.nil?
|
55
|
+
else
|
56
|
+
partial = "breadcrumbs/#{template}"
|
57
|
+
end
|
58
|
+
|
59
|
+
partial += '.html'
|
60
|
+
|
61
|
+
render(partial: partial,
|
62
|
+
locals: { breadcrumbs: breadcrumbs_gem },
|
63
|
+
handlers: [:erb, :haml])
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
end
|
69
|
+
# ----------------------------------------------------------
|
70
|
+
|
71
|
+
|
72
|
+
# ----------------------------------------------------------
|
73
|
+
class_methods do
|
74
|
+
|
75
|
+
def add_breadcrumb(name, options = {})
|
76
|
+
before_action(options) do |controller|
|
77
|
+
controller.send(:add_breadcrumb, name, options)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
# ----------------------------------------------------------
|
83
|
+
|
84
|
+
|
85
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module BreadcrumbsRails
|
2
|
+
class Breadcrumb
|
3
|
+
|
4
|
+
|
5
|
+
attr_accessor :name, :name_string,
|
6
|
+
:path, :path_string,
|
7
|
+
:localize, :locale
|
8
|
+
|
9
|
+
|
10
|
+
def initialize(name_string: nil, path_string: nil, localize: nil, locale: nil)
|
11
|
+
@locale = locale || 'en'
|
12
|
+
@localize = localize || false
|
13
|
+
|
14
|
+
@name_string = name_string
|
15
|
+
@name = generate_name
|
16
|
+
|
17
|
+
@path_string = path_string
|
18
|
+
@path = generate_path
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
|
25
|
+
def generate_name
|
26
|
+
if @localize
|
27
|
+
::I18n.t(@name_string, locale: @locale, default: @name_string)
|
28
|
+
else
|
29
|
+
@name_string
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
def generate_path
|
35
|
+
url_helpers = ::Rails.application.routes.url_helpers
|
36
|
+
|
37
|
+
if url_helpers.methods.include?(@path_string.to_s.to_sym)
|
38
|
+
url_helpers.send(@path_string)
|
39
|
+
else
|
40
|
+
@path_string
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module BreadcrumbsRails
|
2
|
+
class Breadcrumbs
|
3
|
+
|
4
|
+
attr_accessor :breadcrumbs,
|
5
|
+
:scope, :format,
|
6
|
+
:title, :title_string,
|
7
|
+
:localize, :locale
|
8
|
+
|
9
|
+
def initialize(breadcrumbs: [], title_string: nil, scope: nil, format: nil, localize: nil, locale: nil)
|
10
|
+
@breadcrumbs = breadcrumbs || []
|
11
|
+
@format = format || 'html'
|
12
|
+
@scope = scope
|
13
|
+
|
14
|
+
@title_string = title_string
|
15
|
+
@title = generate_title
|
16
|
+
|
17
|
+
@localize = localize || false
|
18
|
+
@locale = locale || 'en'
|
19
|
+
end
|
20
|
+
|
21
|
+
def title_string=(title_string)
|
22
|
+
@title_string = title_string
|
23
|
+
@title = generate_title
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def generate_title
|
29
|
+
if @localize
|
30
|
+
::I18n.t(@title_string, locale: @locale, default: @title_string)
|
31
|
+
else
|
32
|
+
@title_string
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module BreadcrumbsRails
|
2
|
+
|
3
|
+
class Railtie < Rails::Railtie
|
4
|
+
ActiveSupport.on_load(:action_controller) do
|
5
|
+
views_path = "#{File.dirname(__FILE__)}/../generators/breadcrumbs/templates/app/views"
|
6
|
+
::ActionController::Base.append_view_path(views_path)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Breadcrumbs
|
2
|
+
module Generators
|
3
|
+
class ConfigGenerator < Rails::Generators::Base
|
4
|
+
source_root ::File.expand_path(::File.join(::File.dirname(__FILE__), 'templates/config/initializers'))
|
5
|
+
|
6
|
+
def copy_config_file
|
7
|
+
template 'breadcrumbs_config.rb', 'config/initializers/breadcrumbs.rb'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% render_breadcrumbs.each do |breadcrumbs| %>
|
2
|
+
<ul class="pagination">
|
3
|
+
<% breadcrumbs.breadcrumbs.each do |breadcrumb| %>
|
4
|
+
<li>
|
5
|
+
<% if breadcrumb.path %>
|
6
|
+
<%= link_to breadcrumb.name, breadcrumb.path %>
|
7
|
+
<% else %>
|
8
|
+
<%= breadcrumb.name %>
|
9
|
+
<% end %>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% render_breadcrumbs.each do |breadcrumbs| %>
|
2
|
+
<ul>
|
3
|
+
<% breadcrumbs.breadcrumbs.each do |breadcrumb| %>
|
4
|
+
<li>
|
5
|
+
<% if breadcrumb.path %>
|
6
|
+
<%= link_to breadcrumb.name, breadcrumb.path %>
|
7
|
+
<% else %>
|
8
|
+
<%= breadcrumb.name %>
|
9
|
+
<% end %>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% render_breadcrumbs do |breadcrumbs| %>
|
2
|
+
<div class="row wrapper border-bottom white-bg page-heading">
|
3
|
+
<div class="col-lg-10">
|
4
|
+
|
5
|
+
<h2><%= breadcrumbs.title %></h2>
|
6
|
+
|
7
|
+
<ol class="breadcrumb">
|
8
|
+
<% breadcrumbs.breadcrumbs.each do |breadcrumb| %>
|
9
|
+
<li>
|
10
|
+
<% if breadcrumb.path %>
|
11
|
+
<%= link_to breadcrumb.name, breadcrumb.path %>
|
12
|
+
<% else %>
|
13
|
+
<%= breadcrumb.name %>
|
14
|
+
<% end %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
</ol>
|
18
|
+
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- render_breadcrumbs do |breadcrumbs|
|
2
|
+
.row.wrapper.border-bottom.white-bg.page-heading
|
3
|
+
.col-lg-10
|
4
|
+
|
5
|
+
%h2= breadcrumbs.title
|
6
|
+
|
7
|
+
%ol.breadcrumb
|
8
|
+
- breadcrumbs.breadcrumbs.each do |breadcrumb|
|
9
|
+
%li
|
10
|
+
- if breadcrumb.path
|
11
|
+
= link_to breadcrumb.name, breadcrumb.path
|
12
|
+
- else
|
13
|
+
= breadcrumb.name
|
@@ -0,0 +1 @@
|
|
1
|
+
# breadcrumbs config coming soon
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Breadcrumbs
|
2
|
+
module Generators
|
3
|
+
class ViewsGenerator < ::Rails::Generators::NamedBase
|
4
|
+
source_root ::File.expand_path(::File.join(::File.dirname(__FILE__), 'templates/app/views/breadcrumbs'))
|
5
|
+
desc 'Template engine for the views. Available options are "erb", "haml".'
|
6
|
+
|
7
|
+
class_option :format, type: :string, default: 'all'
|
8
|
+
|
9
|
+
def copy_default_views
|
10
|
+
case options['format'].try(:to_s).try(:downcase)
|
11
|
+
when 'haml'
|
12
|
+
copy_file("_#{@name}.html.haml", 'app/views/breadcrumbs/_breadcrumbs.html.haml')
|
13
|
+
when 'erb'
|
14
|
+
copy_file("_#{@name}.html.erb", 'app/views/breadcrumbs/_breadcrumbs.html.erb')
|
15
|
+
else
|
16
|
+
copy_file("_#{@name}.html.haml", 'app/views/breadcrumbs/_breadcrumbs.html.haml')
|
17
|
+
copy_file("_#{@name}.html.erb", 'app/views/breadcrumbs/_breadcrumbs.html.erb')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/readme.md
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
## Breadcrumbs Rails
|
2
|
+
|
3
|
+

|
4
|
+

|
5
|
+
[](https://creativecommons.org/licenses/by/4.0/)
|
6
|
+
|
7
|
+
|
8
|
+
<br/>
|
9
|
+
|
10
|
+
|
11
|
+
#### Installation
|
12
|
+
|
13
|
+
As usual, add to Gemfile:
|
14
|
+
```ruby
|
15
|
+
gem 'breadcrumbs_rails'
|
16
|
+
```
|
17
|
+
|
18
|
+
Generate config:
|
19
|
+
```bash
|
20
|
+
rails g breadcrumbs:config
|
21
|
+
```
|
22
|
+
|
23
|
+
|
24
|
+
<br/>
|
25
|
+
|
26
|
+
|
27
|
+
#### Usage:
|
28
|
+
|
29
|
+
In controllers
|
30
|
+
```ruby
|
31
|
+
class ApplicationController < ActionController::Base
|
32
|
+
include BreadcrumbsRails
|
33
|
+
|
34
|
+
# non-required attributes:
|
35
|
+
# * path - if not specified, item will be text, instead of link. Possible STRING values: '/', 'root_path'
|
36
|
+
# * scope - views scope, in case you want different breadcrumbs for different namespaces, like 'admin'
|
37
|
+
# * views_title - only for inspinia template. This is title above breadcrumbs.
|
38
|
+
# * template - template of views to use: 'html', 'bootstrap', 'inspinia' (only if not using custom views).
|
39
|
+
# Note that, if this argument is passed, gems views will be used.
|
40
|
+
add_breadcrumb 'views.home', path: 'root_path', title: 'Home', scope: 'views.admin', localize: true
|
41
|
+
end
|
42
|
+
|
43
|
+
class UsersController < ApplicationController
|
44
|
+
add_breadcrumb 'Users', path: 'users_path', title: 'Users'
|
45
|
+
|
46
|
+
def edit
|
47
|
+
add_breadcrumb('User')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
To use `title` functionality:
|
53
|
+
```haml
|
54
|
+
%title= render_breadcrumbs_title
|
55
|
+
```
|
56
|
+
|
57
|
+
Using gem's views
|
58
|
+
```haml
|
59
|
+
= render_breadcrumbs
|
60
|
+
|
61
|
+
# or with specific template
|
62
|
+
= render_breadcrumbs(template: 'bootstrap') # default: 'html'; available: 'html', 'bootstrap', 'inspinia'
|
63
|
+
```
|
64
|
+
|
65
|
+
Or creating custom:
|
66
|
+
```haml
|
67
|
+
- render_breadcrumbs do |breadcrumbs|
|
68
|
+
- breadcrumbs.breadcrumbs.each do |breadcrumb|
|
69
|
+
%li= link_to_if breadcrumb.path, breadcrumb.name, breadcrumb.path
|
70
|
+
```
|
71
|
+
|
72
|
+
Available methods:
|
73
|
+
```haml
|
74
|
+
- render_breadcrumbs do |breadcrumbs|
|
75
|
+
|
76
|
+
- breadcrumbs.scope # current scope
|
77
|
+
- breadcrumbs.format # current format
|
78
|
+
|
79
|
+
breadcrumb.localize # boolean if should localize title
|
80
|
+
breadcrumb.locale # current locale
|
81
|
+
|
82
|
+
- breadcrumbs.title_string # string, provided in admin panel
|
83
|
+
- breadcrumbs.title # string or translation of title, provided in admin panel
|
84
|
+
|
85
|
+
- breadcrumbs.breadcrumbs.each do |breadcrumb|
|
86
|
+
|
87
|
+
breadcrumb.localize # boolean if should localize name
|
88
|
+
breadcrumb.locale # current locale
|
89
|
+
|
90
|
+
breadcrumb.name_string # string, provided in admin panel
|
91
|
+
breadcrumb.name # string or translation of string, provided in admin panel
|
92
|
+
|
93
|
+
breadcrumb.path_path # path string, provided in admin panel
|
94
|
+
breadcrumb.path # path string or url, provided in admin
|
95
|
+
```
|
96
|
+
|
97
|
+
|
98
|
+
<br/>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
#### Generate views
|
103
|
+
|
104
|
+
You can also specify only one format (`haml`, `erb.html`), by adding `--format` parameter:
|
105
|
+
```bash
|
106
|
+
rails g breadcrumbs:views haml --format haml
|
107
|
+
rails g breadcrumbs:views haml --format erb
|
108
|
+
|
109
|
+
rails g breadcrumbs:views inspinia --format haml
|
110
|
+
rails g breadcrumbs:views inspinia --format erb
|
111
|
+
|
112
|
+
rails g breadcrumbs:views bootstrap --format haml
|
113
|
+
rails g breadcrumbs:views bootstrap --format erb
|
114
|
+
```
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: breadcrumbs_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.2'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- EdCordata
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-07-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Rails breadcrumbs gem
|
56
|
+
email:
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- ".gitignore"
|
62
|
+
- Gemfile
|
63
|
+
- badges/license.svg
|
64
|
+
- badges/rails.svg
|
65
|
+
- badges/ruby.svg
|
66
|
+
- breadcrumbs_rails.gemspec
|
67
|
+
- lib/breadcrumbs_rails.rb
|
68
|
+
- lib/breadcrumbs_rails/breadcrumb.rb
|
69
|
+
- lib/breadcrumbs_rails/breadcrumbs.rb
|
70
|
+
- lib/breadcrumbs_rails/railtie.rb
|
71
|
+
- lib/breadcrumbs_rails/version.rb
|
72
|
+
- lib/generators/breadcrumbs/config_generator.rb
|
73
|
+
- lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_bootstrap.html.erb
|
74
|
+
- lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_bootstrap.html.haml
|
75
|
+
- lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_html.html.erb
|
76
|
+
- lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_html.html.haml
|
77
|
+
- lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_inspinia.html.erb
|
78
|
+
- lib/generators/breadcrumbs/templates/app/views/breadcrumbs/_inspinia.html.haml
|
79
|
+
- lib/generators/breadcrumbs/templates/config/initializers/breadcrumbs_config.rb
|
80
|
+
- lib/generators/breadcrumbs/views_generator.rb
|
81
|
+
- readme.md
|
82
|
+
homepage: https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails
|
83
|
+
licenses:
|
84
|
+
- CC BY 4.0
|
85
|
+
metadata:
|
86
|
+
documentation_uri: https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails/blob/master/readme.md
|
87
|
+
source_code_uri: https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails
|
88
|
+
bug_tracker_uri: https://github.com/EdCordata-Ruby-Gems/breadcrumbs_rails/issues
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.9.3
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirements: []
|
104
|
+
rubygems_version: 3.2.22
|
105
|
+
signing_key:
|
106
|
+
specification_version: 4
|
107
|
+
summary: Rails breadcrumbs gem
|
108
|
+
test_files: []
|