Basis of rails-driven app for local business
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

23 lines
681 B

  1. # These helper methods can be called in your template to set variables to be used in the layout
  2. # This module should be included in all views globally,
  3. # to do so you may need to add this line to your ApplicationController
  4. # helper :layout
  5. module LayoutHelper
  6. def title(page_title, show_title = true)
  7. @content_for_title = page_title.to_s
  8. @show_title = show_title
  9. end
  10. def show_title?
  11. @show_title
  12. end
  13. def stylesheet(*args)
  14. content_for(:head) { stylesheet_link_tag(*args.map(&:to_s)) }
  15. end
  16. def javascript(*args)
  17. args = args.map { |arg| arg == :defaults ? arg : arg.to_s }
  18. content_for(:head) { javascript_include_tag(*args) }
  19. end
  20. end