-
Notifications
You must be signed in to change notification settings - Fork 14
/
README
47 lines (34 loc) · 1.32 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
== Simplified Breadcrumbs
A nice way to add breadcrumbs to your application. Antonio Cangiano posted a
link in the Ruby on Rails weblog to a post which talked about adding breadcrumbs
to your Rails application. I've been doing this with helpers, but as the post
says this is "Easy and flexible". So I've created the plugin.
== Example
##
# app/controllers/application.rb
#
class ApplicationController < ActionController::Base
add_breadcrumb 'Home', '/'
end
##
# app/controllers/things_controller.rb
#
class ThingsController < ApplicationController
add_breadcrumb 'Things', :things_path
add_breadcrumb 'Create a new thing', '', :only => [:new, :create]
add_breadcrumb 'Edit a thing', '', :only => [:edit, :update]
def show
@thing = Thing.find(params[:id])
add_breadcrumb @thing.name, ''
end
end
##
# app/views/layouts/application.html.erb
#
<%= breadcrumb %>
<%= breadcrumb("=>") %> <!-- You can define the separator you want -->
== Acknowledgments
- Przemyslaw Kowalczyk for his post http://szeryf.wordpress.com/2008/06/13/easy-and-flexible-breadcrumbs-for-rails/
- Original code by: Francesc Esplugas Marti
- Updated Syntax by Greg Bell: http://github.com/gregbell/simplified_breadcrumbs/tree/master
Copyright (c) 2008 Francesc Esplugas Marti, released under the MIT license