Last active
December 17, 2015 16:19
-
-
Save henrik/5637729 to your computer and use it in GitHub Desktop.
First stab at extracting breadcrumb trail building from the controller. Uses breadcrumbs_on_rails (https://github.com/weppos/breadcrumbs_on_rails) and attr_extras (https://github.com/barsoom/attr_extras).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::CustomersController < Admin::BaseController | |
before_filter do | |
CustomerBreadcrumbs.new(self, customer: customer).build | |
end | |
# … | |
private | |
def customer | |
params[:id] && Customer.find(params[:id]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment