Category Archives: Website design and implement

Thinkphp Tutorial Implement Tips

Official website: http://www.thinkphp.cn/info/155.html 1. Download full version and wampserver. Extract full version under /wamp/www 2. Follow the instruction, .htaccess is no suffix. 3. Create database, using phpMyAdmin in wampserver, the password for mysql is empty. the path for database is … Continue reading

Posted in Website design and implement | Leave a comment

Ruby on Rails (3)

1. Migration After add in the /db/migrate/002_XX_.rb def self.up create_table :votes do |t| t.column :story_id, :integer t.column :created_at, :datetime end end run the command: $rake  db:migrate class Story < ActiveRecord::Base validates_presence_of :name, :link has_many :votes end class Vote < ActiveRecord::Base belongs_to … Continue reading

Posted in Website design and implement | Leave a comment

Ruby on Rails (2)

1. Helper: A helper is a chunk of code that can be reused throughout an application, and is stored in a helper file. A new helper file called controllername_helper.rb. Helpers associated with a particular controller are available only to the views of that … Continue reading

Posted in Website design and implement | Leave a comment