lib/breadcrumble/action_view.rb in breadcrumble-4.0.0 vs lib/breadcrumble/action_view.rb in breadcrumble-4.1.0

- old
+ new

@@ -1,11 +1,20 @@ module Breadcrumble module ActionView - def render_breadcrumbs options=nil - render partial: 'breadcrumble/breadcrumb', locals: options + # Render breadcrumbs. + def render_breadcrumbs(options = {}) + _render_breadcrumb('breadcrumb', options) end - def render_breadcrumb_trails options=nil - render partial: 'breadcrumble/breadcrumb_trails', locals: options + # Render breadcrumb trails. + def render_breadcrumb_trails(options = {}) + _render_breadcrumb('breadcrumb_trails', options) + end + + private + + def _render_breadcrumb(path, options) + theme = options[:theme] ? "#{options[:theme]}/" : '' + render partial: "breadcrumble/#{theme}#{path}", locals: options end end end