"Ruby on Rails breadcrumbs plugin"

I have created a plugin named Gretel for making it easy and flexible to create breadcrumbs in Ruby on Rails.


Examples:


In config/initializers/breadcrumbs.rb:



Gretel::Crumbs.layout do

crumb :root do
link "Home", root_path
end

crumb :projects do
link "Projects", projects_path
end

crumb :project do |project|
link project.name, project_path(project)
parent :projects
end

crumb :project_issues do |project|
link "Issues", project_issues_path(project)
parent :project, project
end

crumb :issue do |issue|
link issue.name, issue_path(issue)
parent :project_issues, issue.project
end

end


In app/views/layouts/application.html.erb:


 "You are here:", :separator => ">", :autoroot => true, :home_alone => true, :link_last => false %>


In app/views/xx/xx.html.erb:




It’s as easy as that. Check out full documentation and installation at GitHub [http://github.com/lassebunk/gretel] .

Advertisements
"Ruby on Rails breadcrumbs plugin"

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s