Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 class ApplicationController < ActionController::Base
- 2
- 3 protect_from_forgery
- 4
- 5 def parse_hostname ( hostname )
- 6 # takes in the hostname and returns an address that can be sued to define a
- 7 # path. used to determine which stylesheet to load based on the hostname
- 8 split_string = hostname.split(".")
- 9 if split_string.size > 2
- 10 if split_string[0] == "store"
- 11 path = "store/" + split_string[1]
- 12 else
- 13 path = "main/" + split_string[1]
- 14 end
- 15 else
- 16 path = "main/" + split_string[0]
- 17 end
- 18
- 19 return path
- 20 end
- 21
- 22 helper_method :parse_hostname
- 23 end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement