tabulous 0.0.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/README.rdoc +6 -4
  3. data/lib/generators/tabs/tabs_generator.rb +3 -3
  4. data/lib/generators/tabs/templates/tabulous.rb +24 -25
  5. data/lib/tabulous/formatter.rb +2 -4
  6. data/lib/tabulous/railtie.rb +3 -9
  7. data/lib/tabulous/tab.rb +4 -30
  8. data/lib/tabulous/tabulous.rb +58 -38
  9. data/lib/tabulous/version.rb +1 -1
  10. data/lib/tasks/tabulous.rake +2 -2
  11. data/test/applications/main/{config/initializers → app/tabs}/tabulous.rb +38 -39
  12. data/test/applications/main/test/integration/actions_test.rb +36 -32
  13. data/test/applications/main/test/integration/active_tab_clickable_test.rb +36 -32
  14. data/test/applications/main/test/integration/always_render_subtabs_test.rb +36 -32
  15. data/test/applications/main/test/integration/css_no_scaffolding_test.rb +36 -32
  16. data/test/applications/main/test/integration/css_scaffolding_test.rb +36 -32
  17. data/test/applications/main/test/integration/display_text_test.rb +36 -32
  18. data/test/applications/main/test/integration/enabled_test.rb +36 -32
  19. data/test/applications/main/test/integration/html5_test.rb +36 -32
  20. data/test/applications/main/test/integration/path_test.rb +36 -32
  21. data/test/applications/main/test/integration/visible_test.rb +36 -32
  22. data/test/applications/main/test/unit/tabs_generator_test.rb +1 -1
  23. data/test/applications/simple_tabs/{config/initializers → app/tabs}/tabulous.rb +31 -32
  24. data/test/applications/subtabs/app/tabs/tabulous.rb +166 -0
  25. data/test/test_application_integration_test_helper.rb +1 -1
  26. data/test/{test_initializers → test_tab_files}/empty +0 -0
  27. data/test/test_tab_files/expected +59 -0
  28. data/test/test_tab_files/random_horizontal_whitespace +59 -0
  29. data/test/test_tab_files/random_vertical_whitespace +106 -0
  30. data/test/{test_initializers → test_tab_files}/text +0 -0
  31. data/test/test_tab_files/trailing_comments +59 -0
  32. data/test/units/tabulous_formatter_test.rb +8 -8
  33. metadata +13 -13
  34. data/test/applications/subtabs/config/initializers/tabulous.rb +0 -167
  35. data/test/test_initializers/expected +0 -55
  36. data/test/test_initializers/random_horizontal_whitespace +0 -55
  37. data/test/test_initializers/random_vertical_whitespace +0 -102
  38. data/test/test_initializers/trailing_comments +0 -55
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.0.0 (March 4, 2011)
2
+ * Moved tab file from config/initializers/tabulous.rb to app/tabs/tabulous.rb.
3
+ * Changed syntax so that config.tabs and config.actions accepts a block.
4
+
1
5
  == 0.0.2 (March 2, 2011)
2
6
  * Changed homepage in gemspec.
3
7
 
data/README.rdoc CHANGED
@@ -20,11 +20,11 @@ To get started, add the gem to your Rails application's Gemfile and install it u
20
20
 
21
21
  bundle install
22
22
 
23
- Then generate the tab initializer:
23
+ Then generate the tab file:
24
24
 
25
25
  rails generate tabs
26
26
 
27
- This will generate config/initializers/tabulous.rb. Open the file and configure it to your liking.
27
+ This will generate app/tabs/tabulous.rb. Open the file and configure it to your liking.
28
28
  You'll notice the code is formatted into a grid. After you edit the file, run the following rake
29
29
  task to prettify the code back into a nice grid:
30
30
 
@@ -61,8 +61,10 @@ CSS.
61
61
 
62
62
  == Examples
63
63
 
64
- Look in this gem's test/applications directory to find working example applications. Look at their
65
- config/initializers/tabulous.rb and app/layouts/application.html.erb files.
64
+ There is a tutorial at http://techiferous.com/2011/03/tutorial-for-adding-tabs-to-rails-using-tabulous/
65
+
66
+ Also, look in this gem's test/applications directory to find working example applications.
67
+ Look at their app/tabs/tabulous.rb and app/layouts/application.html.erb files.
66
68
 
67
69
  == Contributing
68
70
 
@@ -1,12 +1,12 @@
1
1
  require 'colored'
2
2
  class TabsGenerator < Rails::Generators::Base
3
3
  source_root File.expand_path("../templates", __FILE__)
4
- def create_tabs_initializer_file
5
- template "tabulous.rb", "config/initializers/tabulous.rb"
4
+ def create_tab_file
5
+ template "tabulous.rb", "app/tabs/tabulous.rb"
6
6
  puts
7
7
  puts ("Tabulous made some guesses about how you want your tabs configured but " +
8
8
  "probably got some things wrong. So you need to edit " +
9
- "config/initializers/tabulous.rb to your liking.").magenta
9
+ "app/tabs/tabulous.rb to your liking.").magenta
10
10
  puts
11
11
  puts "Don't forget to put <%= tabs %> and <%= subtabs %> in your layout(s).".magenta
12
12
  end
@@ -1,6 +1,6 @@
1
1
  # Tabulous gives you an easy way to set up tabs for your Rails application.
2
2
  #
3
- # 1. Configure this initializer.
3
+ # 1. Configure this file.
4
4
  # 2. Add <%%= tabs %> and <%%= subtabs %> in your layout(s) wherever you want
5
5
  # your tabs to appear.
6
6
  # 3. Add styles for these tabs in your stylesheets.
@@ -37,6 +37,8 @@ Tabulous.setup do |config|
37
37
  #
38
38
  # * No comments are allowed between rows.
39
39
  # * Comments are allowed to the right of rows, except for header rows.
40
+ # * The start of a table is signified by a [ all by itself on a line.
41
+ # * The end of a table is signified by a ] all by itself on a line.
40
42
  # * And most importantly: commas that separate cells should be surrounded
41
43
  # by spaces and commas that are within cells should not. This gives the
42
44
  # formatter an easy way to distinguish between cells without having
@@ -70,17 +72,19 @@ Tabulous.setup do |config|
70
72
  end
71
73
  -%>
72
74
  <%= s = []
73
- s << ' config.tabs = ['
74
- s << ' #-------------------------------------------------------------------------------------------------#'
75
- s << ' # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #'
76
- s << ' #-------------------------------------------------------------------------------------------------#'
75
+ s << ' config.tabs do'
76
+ s << ' ['
77
+ s << ' #-------------------------------------------------------------------------------------------------#'
78
+ s << ' # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #'
79
+ s << ' #-------------------------------------------------------------------------------------------------#'
77
80
  for tab in tab_data
78
- s << "[ :#{tab[:name]}_tab , '#{tab[:text]}' , lambda { #{tab[:path_helper]} } , true , true ],"
81
+ s << "[ :#{tab[:name]}_tab , '#{tab[:text]}' , #{tab[:path_helper]} , true , true ],"
79
82
  end
80
- s << ' #-------------------------------------------------------------------------------------------------#'
81
- s << ' # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #'
82
- s << ' #-------------------------------------------------------------------------------------------------#'
83
- s << ' ]'
83
+ s << ' #-------------------------------------------------------------------------------------------------#'
84
+ s << ' # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #'
85
+ s << ' #-------------------------------------------------------------------------------------------------#'
86
+ s << ' ]'
87
+ s << ' end'
84
88
  Tabulous::Formatter.format(s).join("\n") %>
85
89
 
86
90
  #-------------
@@ -98,17 +102,19 @@ Tabulous.setup do |config|
98
102
  # the name of the tab or subtab that is active when this action is rendered
99
103
 
100
104
  <%= s = []
101
- s << ' config.actions = ['
102
- s << ' #-------------------------------------------------------------#'
103
- s << ' # CONTROLLER | ACTION | TAB #'
104
- s << ' #-------------------------------------------------------------#'
105
+ s << ' config.actions do'
106
+ s << ' ['
107
+ s << ' #-------------------------------------------------------------#'
108
+ s << ' # CONTROLLER | ACTION | TAB #'
109
+ s << ' #-------------------------------------------------------------#'
105
110
  for tab in tab_data
106
111
  s << "[ :#{tab[:name]} , :all_actions , :#{tab[:name]}_tab ],"
107
112
  end
108
- s << ' #-------------------------------------------------------------#'
109
- s << ' # CONTROLLER | ACTION | TAB #'
110
- s << ' #-------------------------------------------------------------#'
111
- s << ' ]'
113
+ s << ' #-------------------------------------------------------------#'
114
+ s << ' # CONTROLLER | ACTION | TAB #'
115
+ s << ' #-------------------------------------------------------------#'
116
+ s << ' ]'
117
+ s << ' end'
112
118
  Tabulous::Formatter.format(s).join("\n") %>
113
119
 
114
120
  #-------------
@@ -160,11 +166,4 @@ Tabulous.setup do |config|
160
166
  # config.css.inactive_tab_color = '#aaa'
161
167
  # config.css.inactive_text_color = '#888'
162
168
 
163
- #-----------
164
- # NOTES
165
- #-----------
166
- #
167
- # In development mode this initializer is reloaded for each request so that
168
- # you don't have to restart the server each time you edit this file.
169
-
170
169
  end
@@ -134,15 +134,13 @@ module Tabulous
134
134
  def beginning_of_table?
135
135
  line = @line.split('#').first # naively strip out comments
136
136
  return false if line.nil?
137
- line = line.gsub(/\s/, '')
138
- return line == 'config.tabs=[' || line == 'config.actions=['
137
+ line.strip == '['
139
138
  end
140
139
 
141
140
  def end_of_table?
142
141
  line = @line.split('#').first # naively strip out comments
143
142
  return false if line.nil?
144
- line = line.gsub(/\s/, '')
145
- return line == ']'
143
+ line.strip == ']'
146
144
  end
147
145
 
148
146
  def horizontal_rule?
@@ -9,15 +9,9 @@ module Tabulous
9
9
  initializer 'tabulous.helper' do |app|
10
10
  ActionView::Base.send :include, Tabulous::Helpers
11
11
  end
12
- initializer 'tabulous.reload' do |app|
13
- ActiveSupport.on_load(:action_controller) do
14
- if Rails.env.development?
15
- before_filter do
16
- # reload tabulous initializer on every request if in development mode
17
- load File.join(Rails.root.to_s, 'config/initializers/tabulous.rb')
18
- end
19
- end
20
- end
12
+ config.to_prepare do
13
+ filename = File.join(Rails.root.to_s, 'app/tabs/tabulous.rb')
14
+ load filename if File.exists?(filename)
21
15
  end
22
16
  end
23
17
  end
data/lib/tabulous/tab.rb CHANGED
@@ -33,45 +33,19 @@ module Tabulous
33
33
  end
34
34
 
35
35
  def text(view)
36
- if @text.is_a? Proc
37
- run_closure(view, @text)
38
- else
39
- @text
40
- end
36
+ @text
41
37
  end
42
38
 
43
39
  def path(view)
44
- if @path.is_a? Proc
45
- run_closure(view, @path)
46
- else
47
- @path
48
- end
40
+ @path
49
41
  end
50
42
 
51
43
  def visible?(view)
52
- if @visible.is_a? Proc
53
- !!run_closure(view, @visible)
54
- else
55
- !!@visible
56
- end
44
+ !!@visible
57
45
  end
58
46
 
59
47
  def enabled?(view)
60
- if @enabled.is_a? Proc
61
- !!run_closure(view, @enabled)
62
- else
63
- !!@enabled
64
- end
65
- end
66
-
67
- private
68
-
69
- def run_closure(view, closure)
70
- if view.respond_to? :instance_exec
71
- view.instance_exec(&closure) # for Ruby 1.9
72
- else
73
- view.instance_eval(&closure)
74
- end
48
+ !!@enabled
75
49
  end
76
50
 
77
51
  end
@@ -4,45 +4,16 @@ module Tabulous
4
4
  yield self
5
5
  end
6
6
 
7
- def self.tabs=(ary)
8
- @@tabs = []
9
- last_tab = nil
10
- ary.each do |tab_args|
11
- begin
12
- tab = Tab.new(*tab_args)
13
- rescue ArgumentError
14
- raise ColumnError,
15
- "Your config.tabs table is improperly formatted. You probably have " +
16
- "the wrong number of columns. Or, in other words, one of the arrays " +
17
- "in the config.tabs array has the wrong number of elements."
18
- end
19
- if tab.subtab?
20
- tab.add_parent(last_tab)
21
- else
22
- last_tab = tab
23
- end
24
- @@tabs << tab
25
- end
7
+ def self.tabs(&block)
8
+ @@tabs_block = block
26
9
  end
27
-
28
- def self.actions=(ary)
29
- @@actions = {}
30
- ary.each do |a|
31
- if a.size != 3
32
- raise ColumnError,
33
- "Your config.actions table is improperly formatted. You probably have " +
34
- "the wrong number of columns. Or, in other words, one of the arrays " +
35
- "in the config.actions array has the wrong number of elements."
36
- end
37
- end
38
- ary.each do |controller, action, tab|
39
- @@actions[controller] ||= {}
40
- @@actions[controller][action] ||= []
41
- @@actions[controller][action] << tab
42
- end
10
+
11
+ def self.actions(&block)
12
+ @@actions_block = block
43
13
  end
44
-
14
+
45
15
  def self.render_tabs(view)
16
+ initialize_tabs(view)
46
17
  return unless tab_defined?(view)
47
18
  html = ''
48
19
  html << embed_styles
@@ -63,6 +34,7 @@ module Tabulous
63
34
  end
64
35
 
65
36
  def self.render_subtabs(view)
37
+ initialize_tabs(view)
66
38
  return unless tab_defined?(view)
67
39
  controller = view.controller_name.to_sym
68
40
  action = view.action_name.to_sym
@@ -97,6 +69,54 @@ module Tabulous
97
69
  html
98
70
  end
99
71
 
72
+ def self.initialize_tabs(view)
73
+ if view.respond_to? :instance_exec # for Ruby 1.9
74
+ self.tabs = view.instance_exec(&@@tabs_block)
75
+ self.actions = view.instance_exec(&@@actions_block)
76
+ else
77
+ self.tabs = view.instance_eval(&@@tabs_block)
78
+ self.actions = view.instance_eval(&@@actions_block)
79
+ end
80
+ end
81
+
82
+ def self.tabs=(ary)
83
+ @@tabs = []
84
+ last_tab = nil
85
+ ary.each do |tab_args|
86
+ begin
87
+ tab = Tab.new(*tab_args)
88
+ rescue ArgumentError
89
+ raise ColumnError,
90
+ "Your config.tabs table is improperly formatted. You probably have " +
91
+ "the wrong number of columns. Or, in other words, one of the arrays " +
92
+ "in the config.tabs array has the wrong number of elements."
93
+ end
94
+ if tab.subtab?
95
+ tab.add_parent(last_tab)
96
+ else
97
+ last_tab = tab
98
+ end
99
+ @@tabs << tab
100
+ end
101
+ end
102
+
103
+ def self.actions=(ary)
104
+ @@actions = {}
105
+ ary.each do |a|
106
+ if a.size != 3
107
+ raise ColumnError,
108
+ "Your config.actions table is improperly formatted. You probably have " +
109
+ "the wrong number of columns. Or, in other words, one of the arrays " +
110
+ "in the config.actions array has the wrong number of elements."
111
+ end
112
+ end
113
+ ary.each do |controller, action, tab|
114
+ @@actions[controller] ||= {}
115
+ @@actions[controller][action] ||= []
116
+ @@actions[controller][action] << tab
117
+ end
118
+ end
119
+
100
120
  def self.main_tabs
101
121
  @@tabs.select { |t| !t.subtab? }
102
122
  end
@@ -128,7 +148,7 @@ module Tabulous
128
148
  if @@raise_error_if_no_tab_found
129
149
  raise NoTabFoundError,
130
150
  "No tabs are defined for the controller '#{controller}'. " +
131
- "You can define a tab for this controller in config/initializers/tabulous.rb " +
151
+ "You can define a tab for this controller in app/tabs/tabulous.rb " +
132
152
  "in the 'config.actions =' section. You can also turn off NoTabFoundErrors " +
133
153
  "by setting config.raise_error_if_no_tab_found to false."
134
154
  else
@@ -139,7 +159,7 @@ module Tabulous
139
159
  if @@raise_error_if_no_tab_found
140
160
  raise NoTabFoundError,
141
161
  "No tab is defined for the action '#{action}' in the controller '#{controller}'. " +
142
- "You can define a tab for this action in config/initializers/tabulous.rb " +
162
+ "You can define a tab for this action in app/tabs/tabulous.rb " +
143
163
  "in the 'config.actions =' section. You can also turn off NoTabFoundErrors " +
144
164
  "by setting config.raise_error_if_no_tab_found to false."
145
165
  else
@@ -1,3 +1,3 @@
1
1
  module Tabulous
2
- VERSION = "0.0.2"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  namespace :tabs do
2
- desc "Prettify config/initializers/tabulous.rb"
2
+ desc "Prettify app/tabs/tabulous.rb"
3
3
  task :format do
4
4
  require File.expand_path('../tabulous/formatter', File.dirname(__FILE__))
5
- filename = File.join(Rails.root.to_s, 'config', 'initializers', 'tabulous.rb')
5
+ filename = File.join(Rails.root.to_s, 'app', 'tabs', 'tabulous.rb')
6
6
  reformatted = Tabulous::Formatter.format(IO.readlines(filename))
7
7
  File.open(filename, 'w') do |f|
8
8
  f.puts reformatted
@@ -1,6 +1,6 @@
1
1
  # Tabulous gives you an easy way to set up tabs for your Rails application.
2
2
  #
3
- # 1. Configure this initializer.
3
+ # 1. Configure this file.
4
4
  # 2. Add <%= tabs %> and <%= subtabs %> in your layout(s) wherever you want
5
5
  # your tabs to appear.
6
6
  # 3. Add styles for these tabs in your stylesheets.
@@ -26,6 +26,8 @@ Tabulous.setup do |config|
26
26
  #
27
27
  # * No comments are allowed between rows.
28
28
  # * Comments are allowed to the right of rows, except for header rows.
29
+ # * The start of a table is signified by a [ all by itself on a line.
30
+ # * The end of a table is signified by a ] all by itself on a line.
29
31
  # * And most importantly: commas that separate cells should be surrounded
30
32
  # by spaces and commas that are within cells should not. This gives the
31
33
  # formatter an easy way to distinguish between cells without having
@@ -50,22 +52,24 @@ Tabulous.setup do |config|
50
52
  # ENABLED
51
53
  # whether the tab is disabled (unclickable)
52
54
 
53
- config.tabs = [
54
- #------------------------------------------------------------------------------------------------------#
55
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
56
- #------------------------------------------------------------------------------------------------------#
57
- [ :home_tab , 'Explanation' , "/" , true , true ],
58
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
59
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
60
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
61
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
62
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
63
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
64
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
65
- #------------------------------------------------------------------------------------------------------#
66
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
67
- #------------------------------------------------------------------------------------------------------#
68
- ]
55
+ config.tabs do
56
+ [
57
+ #------------------------------------------------------------------------------------------------------#
58
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
59
+ #------------------------------------------------------------------------------------------------------#
60
+ [ :home_tab , 'Explanation' , "/" , true , true ],
61
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
62
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
63
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
64
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
65
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
66
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
67
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
68
+ #------------------------------------------------------------------------------------------------------#
69
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
70
+ #------------------------------------------------------------------------------------------------------#
71
+ ]
72
+ end
69
73
 
70
74
  #-------------
71
75
  # ACTIONS
@@ -81,21 +85,23 @@ Tabulous.setup do |config|
81
85
  # TAB
82
86
  # the name of the tab or subtab that is active when this action is rendered
83
87
 
84
- config.actions = [
85
- #-------------------------------------------------------------#
86
- # CONTROLLER | ACTION | TAB #
87
- #-------------------------------------------------------------#
88
- [ :home , :all_actions , :home_tab ],
89
- [ :galaxies , :all_actions , :galaxies_tab ],
90
- [ :stars , :all_actions , :stars_tab ],
91
- [ :planets , :all_actions , :planets_tab ],
92
- [ :subtabs , :one , :one_subtab ],
93
- [ :subtabs , :two , :two_subtab ],
94
- [ :subtabs , :three , :three_subtab ],
95
- #-------------------------------------------------------------#
96
- # CONTROLLER | ACTION | TAB #
97
- #-------------------------------------------------------------#
98
- ]
88
+ config.actions do
89
+ [
90
+ #-------------------------------------------------------------#
91
+ # CONTROLLER | ACTION | TAB #
92
+ #-------------------------------------------------------------#
93
+ [ :home , :all_actions , :home_tab ],
94
+ [ :galaxies , :all_actions , :galaxies_tab ],
95
+ [ :stars , :all_actions , :stars_tab ],
96
+ [ :planets , :all_actions , :planets_tab ],
97
+ [ :subtabs , :one , :one_subtab ],
98
+ [ :subtabs , :two , :two_subtab ],
99
+ [ :subtabs , :three , :three_subtab ],
100
+ #-------------------------------------------------------------#
101
+ # CONTROLLER | ACTION | TAB #
102
+ #-------------------------------------------------------------#
103
+ ]
104
+ end
99
105
 
100
106
  #-------------
101
107
  # OPTIONS
@@ -146,11 +152,4 @@ Tabulous.setup do |config|
146
152
  # config.css.inactive_tab_color = '#aaa'
147
153
  # config.css.inactive_text_color = '#888'
148
154
 
149
- #-----------
150
- # NOTES
151
- #-----------
152
- #
153
- # In development mode this initializer is reloaded for each request so that
154
- # you don't have to restart the server each time you edit this file.
155
-
156
155
  end
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class ActionsTest < ActionController::IntegrationTest
4
4
 
5
5
  def setup
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :index , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :index , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.css.scaffolding = true
43
47