Skip to content

Instantly share code, notes, and snippets.

## routes.rb
match "blog" => "blog#index"
match "blog/:year/:month" => "blog#by_date", :constraints => {:year => /\d{4}/, :month => /\d{2}/}, :as => 'blog'
match "blog/:tag" => "blog#by_tag", :as => 'blog'
##a view:
= link_to "Foo", blog_path(:tag => "bar")
##it tries to route it to the second route, realizes the bound params don't match what the route specifies, and shits
<!-- html snippet -->
<div class="wrapper_div">
This is some text that I do not want to see in the output
<div class="inner_div">
This is some text that I want to see in the output
</div>
</div>
<!-- markup structure -->
<table>
<tbody>
<tr>
<td>*CONTENT ONE*</td>
<td>*CONTENT TWO*</td>
</tr>
</tbody>
</table>
$.getJSON("<%=raw @yt_request%>", function(data) {
select{margin-bottom:1px; height:21px;}
input{height:15px;}
.full-width{width:100%;}
.ie-fix{width:100%; position:relative;}
.container{width:100%; overflow:hidden;}
.clear{clear:both;}
.radio, checkbox{border:0; background:0;}
.pages-indent{padding:17px;}
mv magento.test magento.test.WORKING
git clone [email protected]:53cr/Magento.git
mv Magento magento.test
cd magento.test
git pull origin cityjewellers
BY DEFAULT, these layouts apply:
magento.test/app/design/frontend/base/default/layout
This is overridden by theme layouts on a per-file basis:
magento.test/app/design/frontend/base/theme042/layout
These can be overridden by layouts stored on a per-page basis in the database. These are accessed through:
admin backend > CMS > Pages > *A Page* > Design > *The top box*
<!-- IN page.xml -->
<!-- this defines a "content block" in the layout of the page. -->
<block name="Foo">
<!-- yada yada yada -->
</block>
<!-- in ANY OTHER xml file -->
<!-- in theme042/layout/catalog.xml -->
<reference name="root"> <!-- means that for this page we're going to update the root block (aka the whole page)
<!-- this magick incantation changes the template for this page. Paths are relative to
theme042/template, and if they don't exist there, they're searched for in
default/template -->
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
<?xml version="1.0"?>
<!--
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL: