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
rails new blog -m https://raw.github.com/andreaseriksson/apptemplate/master/app_template.rb |
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
class PagesController < ApplicationController | |
def index | |
@pages = Page.all | |
end | |
def show | |
@page = Page.find(params[:id]) | |
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
def is_active?(page_name) | |
"active" if params[:controller] == page_name | |
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
def flash_message(name,msg) | |
if name == :notice | |
box_class = "success" | |
name = "Success" | |
else | |
box_class = "error" | |
name = "Error" | |
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
/*Linear-gradient*/ | |
@include linear-gradient(#1e5799, #2989d8); | |
/*Radial-gradient*/ | |
@include radial-gradient(#1e5799, #3dc3d1); | |
/*Tint & Shade*/ | |
background: tint(red, 40%); | |
background: shade(blue, 60%); |
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
$(function() { | |
$("#birds").autocomplete({ | |
source: "search.php", | |
minLength: 2, | |
select: function( event, ui ) { | |
alert(ui.item.value); | |
} | |
}); | |
}); |
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
<script> | |
$(function() { | |
$( "#dialog-modal" ).dialog({ | |
height: 140, | |
modal: true, | |
autoOpen: false, | |
draggable: false, | |
resizable: false, | |
position: { my: "left top", at: "left bottom", of: button } | |
}); |
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
<!-- Button to trigger modal --> | |
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> | |
<!-- Modal --> | |
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h3 id="myModalLabel">Modal header</h3> | |
</div> | |
<div class="modal-body"> |
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
<div class="btn-group"> | |
<button class="btn">Left</button> | |
<button class="btn">Middle</button> | |
<button class="btn">Right</button> | |
</div> |
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 class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label" for="inputEmail">Email</label> | |
<div class="controls"> | |
<input type="text" id="inputEmail" placeholder="Email"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label" for="inputPassword">Password</label> | |
<div class="controls"> |
OlderNewer