def extract_controller_and_action(ca)
      raise ArgumentError, "Pass the string" if ca.nil?
      slash_pos = ca.rindex('#')
      raise ArgumentError, "Invalid action: #{ca}" if slash_pos.nil?
      controller = ca[0, slash_pos]
      action = ca[slash_pos+1..-1] || ""
      raise ArgumentError, "Invalid action or controller" if action.nil?

      [controller, action]
    end
def extract_controller_and_action(ca)
      raise ArgumentError, "Pass the string" if ca.nil?
      slash_pos = ca.rindex('#')
      raise ArgumentError, "Invalid action: #{ca}" if slash_pos.nil?
      controller = ca[0, slash_pos]
      action = ca[slash_pos+1..-1] || ""
      raise ArgumentError, "Invalid action or controller" if action.nil?

      [controller, action]
    end
Extracts controller and action names from a string.

 Examples:

   extract_controller_and_action("posts#index")       # ["posts", "index"]
   extract_controller_and_action("admin/posts#index") # ["admin/posts", "index"]
   extract_controller_and_action("admin/posts#index") # raises ArgumentError