Todd R
Todd R

Reputation: 18506

Why can't I locate this method in the rails api docs?

I'm studying some Rails 3 code from Spree:

module Spree
  module Generators
    class SiteGenerator < Rails::Generators::Base
      source_root File.expand_path("../../templates", __FILE__)

      desc "Configures an existing Rails application to use Spree."

      def create_lib_files
        template 'spree_site.rb', "lib/spree_site.rb"
      end

      def additional_tweaks
        remove_file "public/index.html"

        append_file "public/robots.txt", <<-ROBOTS
        .... continues ....

This works with Rails 3, but I've looked up Rails::Generators::Base, following the inherited modules to Rails::Generators::Actions and the Thor classes, but still can't seem to find api documentation on the #template method. I can figure out what it does, but I'm troubled that I can't find the docs on it. It's got me feeling like a real newbie (though, since I haven't worked with Rails in quite awhile, I guess in some ways I am).

Any help would be appreciated. Please tell me why I'm not able to find this (and other) methods in the Rails api docs. What am I missing???

Upvotes: 0

Views: 109

Answers (1)

Peter Brown
Peter Brown

Reputation: 51697

The template method is an instance method included with Thor::Actions and can be found at http://rubydoc.info/gems/thor/0.14.6/Thor/Actions:template

Upvotes: 1

Related Questions