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
stv@home:~/Desktop/refinery$ refinerycms test_123_456 --heroku | |
create | |
create README.rdoc | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/assets/images/rails.png | |
create app/assets/javascripts/application.js |
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
source 'http://rubygems.org' | |
gem 'rails', '3.1.1' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'haml' | |
gem 'devise' | |
gem 'json' |
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
# some notes on using has_secure_password | |
class User < ActiveRecord::Base | |
has_secure_password | |
attr_accessible :login_name, :password, :password_confirmation | |
# secure_password.rb already checks for presence of :password_digest | |
# so we can assume that a password is present if that validation passes | |
# and thus, we don't need to explicitly check for presence of password |
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
@charset "UTF-8" | |
// This is a manifest file that'll automatically include all the stylesheets available in this directory | |
// and any sub-directories. You're free to add application-wide styles to this file and they'll appear at | |
// the top of the compiled file, but it's generally better to create a new file per style scope. | |
// | |
//= require_self | |
// Then we'll import the compass and html5-boilerplate extensions | |
@import compass/utilities | |
@import html5/boilerplate |
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
## just some ways to check if a url exists | |
# method 1 - from Simone Carletti | |
require "net/http" | |
url = URI.parse("http://www.google.com/") | |
req = Net::HTTP.new(url.host, url.port) | |
res = req.request_head(url.path) | |
# method 2 - from some kid on the internet | |
require 'open-uri' |
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
# Just a few different methods to strip white-space from all attributes on a model. | |
# method 1 - code from scott moonen | |
# http://scottmoonen.com/2009/05/08/rails-pattern-trim-spaces-on-input/ | |
module Trimmer | |
def self.included base | |
base.extend(ClassMethods) | |
end | |
module ClassMethods |
NewerOlder