Class: FastTrack::TwitterBootstrapNavBar

Inherits:
Track
  • Object
show all
Defined in:
lib/tracks/twitter_bootstrap.rb

Overview

Create a layout that includes a customizable nav bar

Instance Attribute Summary

Attributes inherited from Track

#generator

Instance Method Summary collapse

Methods inherited from Track

before_migrate, before_migrate_block, #create_file, #g, #gem, #gem_group, gemfile, gemfile_block, #generate, #initialize, #rake, #read_file, #route, #run

Methods included from TrackMethods

#bundle_install, #config, #db_migrate!, #migration, #model

Constructor Details

This class inherits a constructor from FastTrack::Track

Instance Method Details

#application_helperObject



57
58
59
# File 'lib/tracks/twitter_bootstrap.rb', line 57

def application_helper
  read_file("application_helper.rb")
end

#invokeObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/tracks/twitter_bootstrap.rb', line 61

def invoke
  unless FastTrack.tracks.any? {|t| t =~ "devise" }
    raise "TwitterBootstrapNavBar requires Devise! Please include it in your --tracks!"
  end

  create_file "app/views/layouts/application.html.erb", layout_for_application, force: true
  create_file "app/helpers/application_helper.rb",      application_helper,     force: true

  # NOTE: _navigation.html.erb requires Devise to work properly!
  create_file "app/views/layouts/_navigation.html.erb", nav_bar
  create_file "app/views/layouts/_messages.html.erb",   messages
end

#layout_for_applicationObject



45
46
47
# File 'lib/tracks/twitter_bootstrap.rb', line 45

def layout_for_application
  read_file("application.html.erb")
end

#messagesObject



53
54
55
# File 'lib/tracks/twitter_bootstrap.rb', line 53

def messages
  read_file("_messages.html.erb")
end


49
50
51
# File 'lib/tracks/twitter_bootstrap.rb', line 49

def nav_bar
  read_file("_navigation.html.erb")
end

#template_directoryObject



41
42
43
# File 'lib/tracks/twitter_bootstrap.rb', line 41

def template_directory
  "twitter_bootstrap_nav_bar"
end