Created
January 25, 2012 03:43
-
-
Save carlzulauf/1674578 to your computer and use it in GitHub Desktop.
dashboard config loader
This file contains hidden or 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
development: | |
user: | |
home: http://example.com | |
some link: http://someplace.com | |
admin: | |
home: http://admin.example.com |
This file contains hidden or 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
def MyRailsApp.dashboard_links | |
@@dashboard_links ||= YAML.load_file(Rails.root.join('config/dashboard.yml'))[Rails.env].symbolize_keys | |
end | |
# now you can access links by MyRailsApp.dashboard_links[:user] or MyRailsApp.dashboard_links[:admin] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment