Ariane

Simon Courtois
Simon CourtoisCTO Founder at PDFMonkey
Ariane
Breadcrumbs pour Rails
whoami



Simon COURTOIS
 CTO chez Selectra

  Github: simonc
Twitter: @happynoff
Breadcrumbs ?
Breadcrumbs et Rails ?




     Crummy
Objectif


Crummy
         Twitter Bootstrap
Schema.org
                    I18n
Participer au projet
Participer au projet
Ariane - Objectif



Flexibilité
Faciliter l’usage
Faciliter la participation
Ariane - Objectif



Flexibilité          !
               U   R
             O
Faciliter l’usage
            Jparticipation
       1
Faciliter la
Ariane - Construction
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
 before_filter :set_ariane

 def set_ariane
   ariane.add "Home", root_path
 end
end



              # app/controllers/articles_controller.rb
              class ArticlesController < ApplicationController
                def set_ariane
                  super
                  ariane.add "Articles", articles_path
                end
              end
Ariane - Affichage



# app/views/layouts/application.html.erb
<%= ariane.render %>
Ariane - Lien spécifique


     Titre d’un article ?

# app/views/articles/show.html.erb
<% ariane.add @article.title, article_path(@article) %>
Ariane - Structure


         Breadcrumb   Crumb

Ariane
          Renders
            Base
            HTML
          HTMLList
Ariane - Renderers



Renders
                <p class="breadcrumb">
  Base
                  <a href="/">Home</a> / Articles
  HTML
                </p>

HTMLList
Ariane - Renderers



                <ul class="breadcrumb">
Renders
                  <li>
  Base              <a href="/">Home</a>
                    <span class="divider">/</span>
                  </li>
  HTML
                  <li class="active">Other</li>
HTMLList        </ul>
Ariane - Renderers


JSON
               XML

Markdown

           Whatever...
Ariane - Choix du Renderer

 Renderers inclus dans Ariane
<%= ariane.render(Ariane::Render::HTMLList) %> (par défaut)
<%= ariane.render(Ariane::Render::HTML) %>


<%= ariane.render(Ariane::Render::JSON) %>
<%= ariane.render(Ariane::Render::XML) %>
<%= ariane.render(Ariane::Render::...) %>


 Créez vos propres Renderers !
Ariane - Paramètres
# config/initializers/ariane.rb

rndr = Ariane::Render::HTML.new({
   :divider     => '-',
   :link_active => true,
   :list_id     => 'awesome-breadcrumb'
})

Ariane.configure do |config|
  config.default_renderer = rndr
end



                <p class="awesome-breadcrumb">

                  <a href="/">Home</a> -
                  <a href="/articles" class="active">Articles</a>

                </p>
Ariane - Objectif



Flexibilité
Faciliter l’usage
Faciliter la participation
Ariane - Objectif



Flexibilité
Faciliter l’usage
Faciliter la participation
Ariane - La suite ?


Dynamic Breadcrumb
Big thanks to Anthony Bouch (github: 58bits)




   Sucre syntaxique
 # app/views/articles/show.html.erb
 <% ariane.add @article.title, @article %>
Ariane - Ressources


         Github
http://github.com/simonc/ariane


       Twitter   @happynoff
Merci !
1 of 23

More Related Content

What's hot(14)

Infografia Infografia
Infografia
Maria Belen Oro87 views
Dash of ajaxDash of ajax
Dash of ajax
Jason Noble912 views
jQuery IntrojQuery Intro
jQuery Intro
Jason Noble965 views
CFUGbe talk about Angular JSCFUGbe talk about Angular JS
CFUGbe talk about Angular JS
Alwyn Wymeersch227 views
August 10th, 2009 Dave Ross Word PressAugust 10th, 2009 Dave Ross Word Press
August 10th, 2009 Dave Ross Word Press
Straight North442 views
Introduction to ElggIntroduction to Elgg
Introduction to Elgg
niteshnandy1.1K views
Django Tastypie 101Django Tastypie 101
Django Tastypie 101
Gaurav Toshniwal2.3K views
Web Scraping is BSWeb Scraping is BS
Web Scraping is BS
John D978 views

Similar to Ariane(20)

Rails 4.0Rails 4.0
Rails 4.0
Robert Gogolok2.9K views
Introduction à RubyIntroduction à Ruby
Introduction à Ruby
Microsoft421 views
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
Rory Gianni813 views
Statische Websites in Rails 3.1Statische Websites in Rails 3.1
Statische Websites in Rails 3.1
RobinBrouwer225 views
Rails 3 overviewRails 3 overview
Rails 3 overview
Yehuda Katz2.1K views
Rails::EngineRails::Engine
Rails::Engine
Flavian Missi800 views
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirent
Nicolas Ledez307 views
The Rails WayThe Rails Way
The Rails Way
Michał Orman3.2K views
Useful Rails PluginsUseful Rails Plugins
Useful Rails Plugins
navjeet1.4K views
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
Jean-Baptiste Feldis1.1K views
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
Jens-Christian Fischer3.5K views
Twitter bootstrap on railsTwitter bootstrap on rails
Twitter bootstrap on rails
Masakuni Kato9K views
Rails for Beginners - Le WagonRails for Beginners - Le Wagon
Rails for Beginners - Le Wagon
Alex Benoit147 views
Rails 3Rails 3
Rails 3
Iain Hecker841 views

More from Simon Courtois(16)

Organize your assets with RailsOrganize your assets with Rails
Organize your assets with Rails
Simon Courtois761 views
Dependency sorting in Ruby with TSortDependency sorting in Ruby with TSort
Dependency sorting in Ruby with TSort
Simon Courtois942 views
Get Slim!Get Slim!
Get Slim!
Simon Courtois2.2K views
Fake your files - MemFsFake your files - MemFs
Fake your files - MemFs
Simon Courtois1K views
Rails is like Burger KingRails is like Burger King
Rails is like Burger King
Simon Courtois819 views
Ruby and DCIRuby and DCI
Ruby and DCI
Simon Courtois877 views
CellsCells
Cells
Simon Courtois631 views
MustdownMustdown
Mustdown
Simon Courtois954 views
Vos Regexps sont fausses !Vos Regexps sont fausses !
Vos Regexps sont fausses !
Simon Courtois395 views
Pourquoi Ruby on Rails ça déchire ?Pourquoi Ruby on Rails ça déchire ?
Pourquoi Ruby on Rails ça déchire ?
Simon Courtois4.9K views
CommanderCommander
Commander
Simon Courtois292 views

Recently uploaded(20)

The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya51 views
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver23 views
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum118 views

Ariane

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n