Class: FastTrack::TwitterBootstrapNavBar
- Inherits:
-
Track
- Object
- Track
- FastTrack::TwitterBootstrapNavBar
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
#bundle_install, #config, #db_migrate!, #migration, #model
Instance Method Details
#application_helper ⇒ Object
57
58
59
|
# File 'lib/tracks/twitter_bootstrap.rb', line 57
def application_helper
read_file("application_helper.rb")
end
|
#invoke ⇒ Object
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
create_file "app/views/layouts/_navigation.html.erb", nav_bar
create_file "app/views/layouts/_messages.html.erb", messages
end
|
#layout_for_application ⇒ Object
45
46
47
|
# File 'lib/tracks/twitter_bootstrap.rb', line 45
def layout_for_application
read_file("application.html.erb")
end
|
#messages ⇒ Object
53
54
55
|
# File 'lib/tracks/twitter_bootstrap.rb', line 53
def messages
read_file("_messages.html.erb")
end
|
#nav_bar ⇒ Object
49
50
51
|
# File 'lib/tracks/twitter_bootstrap.rb', line 49
def nav_bar
read_file("_navigation.html.erb")
end
|
#template_directory ⇒ Object
41
42
43
|
# File 'lib/tracks/twitter_bootstrap.rb', line 41
def template_directory
"twitter_bootstrap_nav_bar"
end
|