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="corpo"> | |
<div class="galeria"> | |
<div class="foto"><img src="Assas1.jpg"></div> | |
<div class="foto"><img src="Assas2.jpg"></div> | |
<div class="foto"><img src="Assas3.jpg"></div> | |
<div class="foto"><img src="Assas4.jpg"></div> | |
</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
require 'digest' | |
class User < ActiveRecord::Base | |
attr_accessor :password | |
validates :email, :uniqueness => true, | |
:length => { :within => 5..50 }, | |
:format => { :with => /^[^@][\w.-]+@[\w.-]+[.][a-z]{2,4}$/i } | |
validates :password, :confirmation => true, | |
:length => { :within => 4..20 }, | |
:presence => 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
user = User.create :email => 'mary@example.com', | |
:password => 'guessit', | |
:password_confirmation => 'guessit' | |
Category.create [{:name => 'Programming'}, | |
{:name => 'Event'}, | |
{:name => 'Travel'}, | |
{:name => 'Music'}, | |
{:name => 'TV'}] | |
user.articles.create :title => 'Advanced Active Record', | |
:body => "Models need to relate to each other. In the real world, ..", |
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 Article < ActiveRecord::Base | |
validates :title, :presence => true | |
validates :body, :presence => true | |
belongs_to :user | |
has_and_belongs_to_many :categories | |
has_many :comments | |
scope :published, where("articles.published_at IS NOT NULL") | |
scope :draft, where("articles.published_at IS NULL") |
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 UsersController < ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
redirect_to articles_path, :notice => 'User successfully added.' | |
else |
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
* { | |
margin: 0 auto; | |
} | |
body { | |
background-color: #fff; | |
color: #333; | |
} | |
body, p, ol, ul, td { |
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
# Install dependencies | |
sudo apt-get install git-core libcairo2-dev libpixman-1-dev libpango1.0-dev libgif-dev libjpeg-dev libgtk2.0-dev vlc libvlc-dev portaudio19-dev libsqlite3-dev libcurl4-openssl-dev libxslt1-dev makeself curl libxslt-dev libxml2-dev |
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 UsersController < ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
redirect_to articles_path, :notice => 'User successfully added.' | |
else |
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
# Resolvendo o erro: | |
/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': | |
It seems your ruby installation is missing psych (for YAML output). | |
To eliminate this warning, please install libyaml and reinstall your ruby. | |
# No terminal do Ubuntu 11.10 rode: | |
cd ext/psych | |
ruby extconf.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
# Reparando o GRUB no Ubuntu 12.09 LTS | |
# For this error: | |
error: no such device: 4cfe3cc0-370e-48ed-82cd-7cd2ca7a0414. | |
grub rescue > | |
# Solution: | |
# Installation and use: |
OlderNewer