-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve specs and dummy app to include only_content_blocks. Review RE…
…ADME and examples document to include new content
- Loading branch information
1 parent
15b3173
commit d66b719
Showing
10 changed files
with
107 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,24 +1,27 @@ | |||
class BettertabsController < ApplicationController | class BettertabsController < ApplicationController | ||
|
|||
def static | def static | ||
end | end | ||
|
|||
def link_tab_1 | def link_tab_1 | ||
end | end | ||
|
|||
def link_tab_2 | def link_tab_2 | ||
end | end | ||
|
|||
def ajax | def ajax | ||
render partial: 'ajax' and return if request.xhr? | render partial: 'ajax' and return if request.xhr? | ||
end | end | ||
|
|
||
def only_content_block | |||
end | |||
|
|||
def mixed | def mixed | ||
render partial: 'mixed' and return if request.xhr? | render partial: 'mixed' and return if request.xhr? | ||
end | end | ||
|
|||
def mixed_with_erb | def mixed_with_erb | ||
render partial: 'tab_content' and return if request.xhr? and params[:erb_test_selected_tab] == 'ajax_tab' | render partial: 'tab_content' and return if request.xhr? and params[:erb_test_selected_tab] == 'ajax_tab' | ||
end | end | ||
|
|||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,4 @@ | |||
tab_content partial content. | |||
- if local_assigns.has_key? :local_var | - if local_assigns.has_key? :local_var | ||
= local_var | = local_var | ||
- else | |||
tab_content partial content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
spec/dummy/app/views/bettertabs/only_content_block.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
%h2 Testing Content Blocks (that have with no tab) mixed with static tabs | |||
= bettertabs :static, :class => 'bettertabs example', :list_html_options => {:class => 'list_class'} do |tab| | |||
= tab.only_content_block do | |||
Content for only_content_block_1 | |||
|
|||
= tab.static :static_tab_1 do | |||
Content for static_tab_1 | |||
|
|||
= tab.only_content_block :partial => 'tab_content', :locals => {:local_var => 'Content for only_content_block_2'} | |||
|
|||
= tab.static :static_tab_2 do | |||
Content for static_tab_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,10 @@ | |||
%h2 Testing static tabs | %h2 Testing static tabs | ||
= bettertabs :static, :class => 'bettertabs example', :list_html_options => {:class => 'list_class'} do |tab| | = bettertabs :static, :class => 'bettertabs example', :list_html_options => {:class => 'list_class'} do |tab| | ||
= tab.only_content_block do | |||
Content for only_content_block_1 | |||
|
|
||
= tab.static :static_tab_1 do | = tab.static :static_tab_1 do | ||
Content for static_tab_1 | Content for static_tab_1 | ||
|
|
||
= tab.only_content_block do | |||
Content for only_content_block_2 | |||
|
|||
= tab.static :static_tab_2 do | = tab.static :static_tab_2 do | ||
Content for static_tab_2 | Content for static_tab_2 | ||
|
|
||
= tab.static :tab_content, 'Static Tab 3', :locals => {:local_var => 'Local value'} # should render partial 'tab_content' | = tab.static :tab_content, 'Static Tab 3', :locals => {:local_var => 'Content for static_tab_3'} # should render partial 'tab_content' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.