def sockets_for(*args, &block)
      options = args.extract_options!
      routes = infer_routes(options)
      resource_routes = infer_resource_routes(routes)

      # Generate index and show routes
      resources *args, only: resource_routes do
        # Generate create route
        collection do
          get 'create', as: :create if routes.include?(:create)
        end

        # Generate update and destroy routes
        member do
          get 'update', as: :update if routes.include?(:update)
          get 'destroy', as: :destroy if routes.include?(:destroy)
        end

        # Nest routes
        yield if block_given?
      end
    end
def sockets_for(*args, &block)
      options = args.extract_options!
      routes = infer_routes(options)
      resource_routes = infer_resource_routes(routes)

      # Generate index and show routes
      resources *args, only: resource_routes do
        # Generate create route
        collection do
          get 'create', as: :create if routes.include?(:create)
        end

        # Generate update and destroy routes
        member do
          get 'update', as: :update if routes.include?(:update)
          get 'destroy', as: :destroy if routes.include?(:destroy)
        end

        # Nest routes
        yield if block_given?
      end
    end
Generates five routes that all use GET requests.
 For example:

   sockets_for :messages

 will create the following routes:

          Prefix Verb URI Pattern                     Controller#Action
 create_messages GET  /messages/create(.:format)      messages#create
  update_message GET  /messages/:id/update(.:format)  messages#update
 destroy_message GET  /messages/:id/destroy(.:format) messages#destroy
        messages GET  /messages(.:format)             messages#index
         message GET  /messages/:id(.:format)         messages#show

 This method can nested by passing a block, and
 the options :only and :except can be used just like
 with the method 'resources'