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
commit 3696e5b00494629b2304221529c079d64a299888 | |
Author: Rida <[email protected]> | |
Date: Tue Oct 28 01:33:06 2008 +0400 | |
Finishing the Arabic locale |
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
.bundle | |
config/database.yml | |
log/*.log | |
db/*.sqlite3 | |
tmp/**/* |
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 SalutationController < ApplicationController | |
def hello | |
@message = 'Hello World!' | |
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
<html> | |
<body> | |
<h1><%= @message %></h1> | |
</body> | |
</html> |
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
Hello::Application.routes.draw do |map| | |
match ':controller(/:action(/:id(.:format)))' | |
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
class Comment < ActiveRecord::Base | |
belongs_to :article | |
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
class Article < ActiveRecord::Base | |
validates :title, :presence => true | |
validates :body, :presence => true | |
belongs_to :user | |
has_and_belongs_to_many :categories | |
has_many :comments | |
def long_title | |
"#{title} - #{published_at}" |
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 User < ActiveRecord::Base | |
has_one :profile | |
has_many :articles, :order => 'published_at DESC, title ASC', | |
:dependent => :nullify | |
has_many :replies, :through => :articles, :source => :comments | |
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
class Category < ActiveRecord::Base | |
has_and_belongs_to_many :articles | |
default_scope order('categories.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
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") |
OlderNewer