Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## in application_helper.rb
- def navigation_item(text, controller_name, action_name = nil)
- current = (controller.controller_name == controller_name) and (action_name.nil? or controller.action_name == action_name)
- "<li class=\"ui-state-default ui-corner-top #{'ui-tabs-selected ui-state-active' if current}\">#{link_to text, :controller => controller_name, :action => action_name}</li>"
- end
- ## in the view:
- <%= navigation_item I18n.t('layout.navigation.instruments'), "instruments" %>
- <%= navigation_item I18n.t('layout.navigation.indicators'), "indicators" %>
- <%= navigation_item I18n.t('layout.navigation.exchange_rates'), "exchange_rates" %>
- <%= navigation_item I18n.t('layout.navigation.import_quotes'), "quotes", "import" %>
- ## /config/locales/views/layout/en.yml:
- en:
- layout:
- navigation:
- instruments: "Instruments"
- indicators: "Indicators"
- exchange_rates: "Exchange Rates"
- investment_category: "Investment Category"
- ## /config/locales/views/layout/de.yml:
- de:
- layout:
- navigation:
- instruments: "Papiere"
- indicators: "Indikatoren"
- exchange_rates: "Wechselkurse"
- investment_category: "Anlagekategorien"
Add Comment
Please, Sign In to add comment