Created
February 7, 2012 16:41
-
-
Save bill-transue/1760604 to your computer and use it in GitHub Desktop.
Reverse Nested Layouts...
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
.row | |
.cell | |
-if @site == site and params[:action] == "edit" | |
.navigator_cell_edit | |
-form_for @site do |f| | |
=f.text_field :name, :autofocus => true | |
.navigator_cell_save | |
=f.submit "Save", :class => "remote" | |
-else | |
=link_to site.name, site_systems_path(site), :remote => true | |
.cell | |
=site.systems.count | |
.cell | |
=site.poc | |
.cell | |
=site.systems.collect(&:coverterm).join ", " | |
.cell | |
=link_to image_tag("edit2.png", :size => "18x18", :title => "Edit #{site.name}"), edit_site_path(site), :remote => true | |
=link_to image_tag("delete2.png", :size => "18x18", :title => "Delete #{site.name}"), site, :confirm => "Are you sure?", :method => "delete", :remote => true |
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
!!! 5 | |
%html | |
%head | |
%title | |
Blah | |
=stylesheet_link_tag 'application', :media => 'all' | |
=stylesheet_link_tag 'blueprint/print', :media => 'print' | |
=javascript_include_tag 'application' | |
=csrf_meta_tags | |
=yield :head | |
%body | |
#header | |
=render :partial => "layouts/header" | |
=render :partial => "layouts/flash" | |
-if content_for? :content | |
=yield :content | |
-else | |
=yield | |
#footer | |
=render :partial => "layouts/footer" |
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
module ApplicationHelper | |
def navigator(*columns, &block) | |
haml_tag :div, :id => "navigator", :class => "table" do | |
haml_tag :div, :class => "header" do | |
columns.each do |column| | |
haml_tag :div do | |
haml_concat column | |
end | |
end | |
end | |
yield | |
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
=link_to "New Site", new_site_path, :remote => true |
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
-form_for @site do |f| | |
=f.text_field :name, :autofocus => true | |
.navigator_cell_submit | |
=f.submit "Submit", :remote => true |
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
-content_for :content do | |
=render 'breadcrumb' | |
=render 'navigator' | |
=render :file => 'layouts/application' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment